You return a Variant() and enter the UDF as an array function (with CTRL+SHIFT+ENTER)
Example of a function that doubles the value in an array

Public Function ScaleValues(ByRef r As Range, ByVal factor As Double) As Variant()
Dim n As Long, m As Long, i As Long, j As Long
n = r.Rows.Count: m = r.Columns.Count
Dim vals() As Variant
vals = r.Value
For i = 1 To n
For j = 1 To m
vals(i, j) = factor * vals(i, j)
Next j
Next i
ScaleValues = vals
End Function
Specifically a function to fill cells in a sequence would be:

Public Function MySeq(ByVal start_value As Long, ByVal end_value As Long) As Variant()
Dim n As Long, i As Long
n = end_value - start_value + 1
Dim vals() As Variant
ReDim vals(1 To n, 1 To 1)
For i = 1 To n
vals(i, 1) = start_value + (i - 1)
Next i
MySeq = vals
End Function
This plays well as you can test. Enter =SUM(MySeq(1,24)) in a cell and you get 300 which is the correct answer. If you want to do linear algebra, such as scaling or adding arrays, then you have to separate the operation out column by column for each step.

Note that you cannot store a whole array in a single cell. Believe me I have tried a myriad ways (like setting the formula to ={1,2,3,4} for example). Even if this succeeds, there is no way to extract values out in any standard way to be used in SUM(), TRANSPOSE() or MMULT().
For posterity, there is a version of the sequence function that handles non-integer values and non unit stride (step)
Public Function MySeq2(ByVal start_value As Double, ByVal end_value As Double, Optional stride As Double = 1) As Variant()
Dim n As Long, i As Long
n = (end_value - start_value + stride) / stride
Dim vals() As Variant
ReDim vals(1 To n, 1 To 1)
For i = 1 To n
vals(i, 1) = start_value + (i - 1) * stride
Next i
MySeq2 = vals
End Function
=SUM(A1:A3+1).=SUM(A1:A3+1)needs to be confirmed withCtrl+Shift+Enterwhile=SUM(A1:A3)and=SUM({1,2,3}+1)do not. Is there some rational behind this?=A:Ain any other column and it will get you value from the same row and A column. Same result with many built in functions.SUMoperates on ranges so in most cases it does not exhibit this behavior - unless there is some other operation on the input range involved.=SUM(A1:A3+1)in rows 1-4 and compare the results. If you pass constant array instead of range - implicit intersection is not possible (array does not have its address), so you get what you expect without CSE. To make things even more complicated: the exact behavior depends on a function. If you replaceSUMwithSUMPRODUCTin the above example you will see that it behaves as if it was entered with CSE.