[Question]
  [
This challenge is simply to return a list of lists of integers, similar to the Python range function, except that each successive number must be that deep in lists.
**Rules**:
* Create a program or a non-anonymous function
* It should return or print the result
* The result should be returned in a list (of lists) or array (of arrays)
* If the parameter is zero, return an empty list
* This should be able to handle an integer parameter 0 <= n < 70.
	+ (recursive solutions blow up pretty fast)
* The function should be callable with only the one parameter.
* Other behavior is undefined.
* This is code golf, so shortest code wins.
**Example Call:**
```
rangeList(6)
> [0, [1, [2, [3, [4, [5]]]]]]
```
**Test Cases:**
```
0  => []
1  => [0]
2  => [0, [1]]
6  => [0, [1, [2, [3, [4, [5]]]]]]
26 => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25]]]]]]]]]]]]]]]]]]]]]]]]]]
69 => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25, [26, [27, [28, [29, [30, [31, [32, [33, [34, [35, [36, [37, [38, [39, [40, [41, [42, [43, [44, [45, [46, [47, [48, [49, [50, [51, [52, [53, [54, [55, [56, [57, [58, [59, [60, [61, [62, [63, [64, [65, [66, [67, [68]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
```
**EDIT:** isaacg's [answer](https://codegolf.stackexchange.com/a/47366/34718) is the shortest so far. I'll update the accepted answer if anyone finds a shorter one in a language that existed at the posting of the challenge. Thanks for playing!
  
[Answer]
# Pyth, 13 bytes
```
?hu]+HG_UQYQY
```
[Try it here.](http://pyth.herokuapp.com/)
```
                 Implicit:
                 Q = eval(input())
                 Y = []
?           QY   If Q = 0, print Y
 h               else, print the first element of
  u     _UQY     the reduce, where Y is the initial value, over the list
                 reversed(range(Q))
   ]+HG          The reduce function: The list containing H prepended onto G.
                 The new number is inserted into the accumulated list,
                 then the resultant list is wrapped in another list.
```
[Answer]
# APL (~~13~~ 18)
Assuming `⎕IO=0`:
```
f←{×⍵:⊃,∘⊂∘,/⍳⍵⋄⍬}
```
Explanation:
* `×⍵:` if `⍵` is positive,
	+ `,∘⊂∘,`: join the left operand to the enclose of the right operand (i.e. `x ,∘⊂∘, y = [x, [y]]`)
	+ `/`: reduce
	+ `⍳⍵`: the numbers `0..⍵-1`
	+ `⊃`: disclose the result
* `⋄`: otherwise
	+ `⍬`: return the empty list
	+ (this is necessary because `/` fails on `⍬`, and `⍳0` gives the empty list.)
Addendum:
This function returns a nested array. However, it is a bit hard to tell this from APL's default output. It separates array items by spaces, so you can only tell nesting by double spaces. Here is a function that will take a nested array, and return a string, formatting the nested array in Python style (i.e. `[a,[b,[c,...]]]`).
```
arrfmt←{0=≡⍵:⍕⍵ ⋄ '[',(1↓∊',',¨∇¨⍵),']'}
```
[Answer]
# Haskell, 67 bytes
```
data L=E|I Int|L[L] 
1#m=L[I$m-1]
n#m=L[I$m-n,(n-1)#m]
p 0=E
p n=n#n
```
In Haskell all elements of a list have to be of the same type, so I cannot mix integers with list of integers and I have to define a custom list type `L`. The helper function `#` recursively constructs the required list. The main function `p` checks for the empty list and calls `#` otherwise.
As new data types cannot be printed by default (the rules allow just to return the list), I add some more code for demonstration purpose:
```
data L=E|I Int|L[L] deriving Show
```
Now:
```
-- mapM_ (print . p) [0..5]
E
L [I 0]
L [I 0,L [I 1]]
L [I 0,L [I 1,L [I 2]]]
L [I 0,L [I 1,L [I 2,L [I 3]]]]
L [I 0,L [I 1,L [I 2,L [I 3,L [I 4]]]]]
```
[Answer]
# Python, 48 bytes
```
f=lambda n,i=0:i<n and[i]+[f(n,i+1)]*(i<n-1)or[]
```
Using list multiplication to handle the special case.
[Answer]
# Mathematica, 33
```
f@0={};f@1={0};f@n_:={0,f[n-1]+1}
```
[Answer]
# CJam, 16 bytes
```
Lri){[}%]~;']*~p
```
This is a full program. It takes input via STDIN and prints the final array on to STDOUT.
As with the other CJam entry, `0` input will print `""` as that is the representation of an empty array in CJam.
**How it works**:
```
L                   "Put an empty array on stack. This will be used for the 0 input";
 ri)                "Read the input, convert it to integer and increment it";
    {[}%            "Map over the array [0 ... input number] starting another array";
                    "after each element";
        ]~;         "Now on stack, we have input number, an empty array and the final";
                    "opening bracket. Close that array, unwrap it and pop the empty array";
           ']*~     "Put a string containing input number of ] characters and eval it";
                    "This closes all the opened arrays in the map earlier";
               p    "Print the string representation of the array";
                    "If the input was 0, the map runs 1 time and the ; pops that 1 array";
                    "Thus leaving only the initial empty array on stack";
```
[Try it online here](http://cjam.aditsu.net/#code=Lri%29%7B%5B%7D%25%5D%7E%3B%27%5D*%7Ep&input=0)
[Answer]
# JavaScript (ES6) 40
Recursive solution, pretty robust, no blows.
*Update* Fails near 6500 with 'too much recursion'
```
F=n=>n--?(R=m=>m<n?[m,R(++m)]:[m])(0):[]
```
Iterative solution (45)
No limits except memory usage
```
F=n=>{for(s=n?[--n]:[];n;)s=[--n,s];return s}
```
Try F(1000): FireBug console will not show you more than 190 nested arrays, but they are there
[Answer]
# Java, 88 107 105 104 102 bytes
```
import java.util.*;int o;List f(final int n){return new Stack(){{add(n<1?"":o++);if(o<n)add(f(n));}};}
```
Pretty long compared to the others, though you can't do much better with Java. A check to determine whether to continue recursion is all it takes.
[Answer]
# Python 2, 56 bytes
I suspect this could be golfed more.
```
f=lambda n,i=0:[i,f(n,i+1)]if i<n-1 else[i]if n>0 else[]
```
Tests:
```
# for n in (0,1,2,6,26,69): print n, '=>', f(n)
0 => []
1 => [0]
2 => [0, [1]]
6 => [0, [1, [2, [3, [4, [5]]]]]]
26 => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25]]]]]]]]]]]]]]]]]]]]]]]]]]
69 => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25, [26, [27, [28, [29, [30, [31, [32, [33, [34, [35, [36, [37, [38, [39, [40, [41, [42, [43, [44, [45, [46, [47, [48, [49, [50, [51, [52, [53, [54, [55, [56, [57, [58, [59, [60, [61, [62, [63, [64, [65, [66, [67, [68]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
```
[Answer]
# CJam, 17 bytes
I know Optimizer has found 16, but here is the best I can do:
```
{:I{[}%;{]}I1e>*}
```
This is a block, the closest thing to a function in CJam, which takes an integer on the stack, and leaves the desired nested array.
Use [this program to test it](http://cjam.aditsu.net/#code=5%0A%7B%3AI%7B%5B%7D%25%3B%7B%5D%7DI1e%3E*%7D%0A~ed%3B), which puts the input on the stack, then calls the function and inspects the stack. Note that for `0`, the stack output will contain `""` - this *is* CJam's native representation of an empty array.
[Answer]
# Ruby 46
```
f=->n{r=a=[]
(0...n).map{|i|a<<a=[i]}
r[0]||r}
```
Test it online: <http://ideone.com/uYRVTa>
[Answer]
# C# - 100
Simple recursion. Check the zero special case and tick up with one variable, down with the other
```
object[]A(int y,int x=0){return y==0?new object[0]:y==1?new object[]{x}:new object[]{x,A(--y,++x)};}
```
# C++ 87
**(Visual C++ 2012)**
```
int*A(int y,int x=0){int*b=new int{x};return!y?new int:--y?(b[1]=(int)A(y,++x))?b:0:b;}
```
This one is great, by which I mean byzantine, but it's the same basic idea as the c# one.
It's a C style array implementation, so it doesn't give you an array, it gives a int pointer, in which I was be storing both ints and other pointers. Like this: `[0,*] *->[1,#] #-> [2,&] &-> etc`, where the symbols are pseudo code for the int value of a pointer and the --> is where it pointers to in memory.
What an excellent easy to use implementation of c style jagged arrays I've devised (cough), but I maintain it's plausible enough to be within the rules of the question.
There's quite a lot of abusing ternary operators here, and also quite a lot of abusing the implicit cast from int to bool.
**Example:** If we let `int *bar = (int*)A(3);`, we can see:
```
bar
0x003bded8 {0}
((int*)bar[1])[0]
1
((int*)(((int*)bar[1])[1]))[0]
2
```
Which is pointer talk for [0,[1,[2]]]. 
Okay, fine. It doesn't actually have to be the awful. Here's some test code for running this c++ code:
```
int* GetNext(int* p){
  return (int*)p[1];
}
int main()
{
    auto x = 10;
    auto bar = A(x);
    for (int i = 1; i < x; i++){
        bar = GetNext(bar);
        std::cout << bar[0] << std::endl;
    }
```
}
[Answer]
# Pyth, 15 bytes
```
?u[HG)_UtQ]tQQY
```
Which is really saying, in Python:
```
Q = eval(input())
if Q:
    print reduce(lambda G,H:[H,G], reverse(range(Q-1)), [Q-1])
else:
    print []
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~65 59 45~~ 41 bytes
These nested lists are the same data-structure as rooted `Tree`s, except that they can also be empty. Hence, we can use a list of them - also called a `Forest` to represent them.
```
(0!)
data T=N[T]Int
m!n=[N((m+1)!n)m|m<n]
```
[Try it online!](https://tio.run/##JYq9DoIwFIX3@xQXpzZEAw6YGDo5OcgiGxrTQBEivRJ6Exh8dmvVk3w5Pzmddg8zDL5VFy@SSEKjWWOpiqq8HonBRqSqQggbpzIiaV82p6vvybGm2uC5e85Y4tyZyQAGue8gCmSHi0T17wvGMa5wHwjhN7EDsLqncLF6PN1QjFNPjBtsA5PRjQw@9GQcqjzHu@HDk9gQO59AClvIYJvBLnnX7aDvzq/rcfwA "Haskell – Try It Online")
### Explanation
First of all we need to implement the `Tree` data type:
```
data Tree = Node [Tree] Int
```
From there it's just recursion using two parameters `m` (counting up) and `n` to keep track when to terminate:
```
m ! n= [ Node ((m+1)!n) m| m<n ]
```
## Alternative, 61 bytes
```
import Data.Tree
f n=unfoldForest(\b->(b,[b+1|b<n-1]))[0|n>0]
```
[Try it online!](https://tio.run/##bVDBTsJAEL3vV7xwoQ1sUzhggtALRj2gF7ghIdt0Sje2u7W7hRDx6g/4h/4IbhGSxniazJs3772ZTJhXyvOTLEpdWbzVIpeppAQPj7Ngken9dXInrAiWFRFLoaa1SnWe3OuKjPVeYh55cX8V9wbHeKL4YO37q/CoonB94hxLjUQaEeeEsiJrD7yspLJSbfuoqNA7gs3IEL4/vzBEdigzUgbMOPdfB4zHaLJAYBrhggnwCAvrpLbg/BYt@vTc4J23NVIHX48KGnwujd1sztRm2ukwYJ9RRa7iAnvPOiHUWK19mKtujV4P5h/WzvxldftdjNvRdua87BLzD8YKIZXjF6J82sAra@vumSsE7Y3AZQvco0Tiu5pLRc5iMsGW7EwrS8qaU8gGbMhGbDhiN@EP "Haskell – Try It Online")
### Explanation
The function `unfoldForest` takes a list of initial values and a function `x -> (y,[x])`. For each initial value `x` it *unfolds* a tree using the function, producing a tuple `(y,xs)` where `y` will become the root and the `xs` are used to repeat the procedure:
```
unfoldForest (\b -> (b, [b+1 | b < 2]) [0]
  ≡ Node 0 [unfoldForest (\b -> (b, [b+1 | b < 2) [1]]
  ≡ Node 0 [Node 1 [unfoldForest (\b -> (b, [b+1 | b < 2) []]]
  ≡ Node 0 [Node 1 []]
```
[Answer]
## Perl - 44
```
sub t{$r=[($t)=@_];$r=[$t,$r]while--$t>0;$r}
```
Will add explanation upon request. You can try it [here](https://ideone.com/boNb5V).
[Answer]
# JavaScript, 93 bytes
This isn't ideal, but I might as well give it a try. I'll try and golf this further later on, though for now I see no obvious way to.
```
function f(n){s='[';i=0;while(i<n-1)s+=i+++',[';s+=i||'';do{s+=']'}while(i--);return eval(s)}
```
[Answer]
# Python, 75 bytes
This is just for show. It's the program I wrote when creating/designing this challenge.
```
f=lambda x,y=[]:y if x<1 else f(x-1,[x-2]+[y or[x-1]])if x>1 else y or[x-1]
```
[Answer]
# Python, 44
```
f=lambda n,i=0:i<n-1and[i,f(n,i+1)]or[i][:n]
```
Recursively creates the tree. The `[:n]` at the end is to special-case `n==0` into giving the empty list. 
[Answer]
# [Joe](https://github.com/JaniM/Joe), 8 bytes
Note: This is a non-competing answer. The first version of Joe was released after this question.
```
F:/+,M]R
```
What do we have here? `F:` defines a function F that is a chain of `/+,`, `M]` and `R`. When you call `Fn`, first `Rn` gets evaluated, returning range from 0 to n, exclusive. `M]` wraps each element to a list. Then the list is applied to `/+,`. `x +, y` returns `x + [y]`. `/` is a right fold. Thus, `/+,a b c d...` returns `[a, [b, [c, [d...]]]`.
Example invocations (code is indented by 3, output by 0):
```
   F:/+,M]R
   F10
[0, [1, [2, [3, [4, [5, [6, [7, [8, [9]]]]]]]]]]
   F2
[0, [1]]
   F1
[0]
   F0
[]
   F_5
[0, [-1, [-2, [-3, [-4]]]]]
```
[Answer]
# Ruby - Recursive version - 52
```
r=->(n,v=nil){(n-=1;n<0 ?v:r[n,(v ?[n,v]:[n])])||[]}
```
# Non-recursive version: ~~66~~ ~~62~~ 57
```
r=->i{(i-1).downto(0).inject(nil){|a,n|a ?[n,a]:[n]}||[]}
```
Sample output (same for both versions)
```
p r[0]  # => []
p r[1]  # => [0]
p r[2]  # => [0, [1]]
p r[6]  # => [0, [1, [2, [3, [4, [5]]]]]]
p r[26] # => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25]]]]]]]]]]]]]]]]]]]]]]]]]]
p r[69] # => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25, [26, [27, [28, [29, [30, [31, [32, [33, [34, [35, [36, [37, [38, [39, [40, [41, [42, [43, [44, [45, [46, [47, [48, [49, [50, [51, [52, [53, [54, [55, [56, [57, [58, [59, [60, [61, [62, [63, [64, [65, [66, [67, [68]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
```
The non-recursive version can handle arbitrarily large input.
```
p r[1000] # => [0, [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, [11, [12, [13, [14, [15, [16, [17, [18, [19, [20, [21, [22, [23, [24, [25, [26, [27, [28, [29, [30, [31, [32, [33, [34, [35, [36, [37, [38, [39, [40, [41, [42, [43, [44, [45, [46, [47, [48, [49, [50, [51, [52, [53, [54, [55, [56, [57, [58, [59, [60, [61, [62, [63, [64, [65, [66, [67, [68, [69, [70, [71, [72, [73, [74, [75, [76, [77, [78, [79, [80, [81, [82, [83, [84, [85, [86, [87, [88, [89, [90, [91, [92, [93, [94, [95, [96, [97, [98, [99, [100, [101, [102, [103, [104, [105, [106, [107, [108, [109, [110, [111, [112, [113, [114, [115, [116, [117, [118, [119, [120, [121, [122, [123, [124, [125, [126, [127, [128, [129, [130, [131, [132, [133, [134, [135, [136, [137, [138, [139, [140, [141, [142, [143, [144, [145, [146, [147, [148, [149, [150, [151, [152, [153, [154, [155, [156, [157, [158, [159, [160, [161, [162, [163, [164, [165, [166, [167, [168, [169, [170, [171, [172, [173, [174, [175, [176, [177, [178, [179, [180, [181, [182, [183, [184, [185, [186, [187, [188, [189, [190, [191, [192, [193, [194, [195, [196, [197, [198, [199, [200, [201, [202, [203, [204, [205, [206, [207, [208, [209, [210, [211, [212, [213, [214, [215, [216, [217, [218, [219, [220, [221, [222, [223, [224, [225, [226, [227, [228, [229, [230, [231, [232, [233, [234, [235, [236, [237, [238, [239, [240, [241, [242, [243, [244, [245, [246, [247, [248, [249, [250, [251, [252, [253, [254, [255, [256, [257, [258, [259, [260, [261, [262, [263, [264, [265, [266, [267, [268, [269, [270, [271, [272, [273, [274, [275, [276, [277, [278, [279, [280, [281, [282, [283, [284, [285, [286, [287, [288, [289, [290, [291, [292, [293, [294, [295, [296, [297, [298, [299, [300, [301, [302, [303, [304, [305, [306, [307, [308, [309, [310, [311, [312, [313, [314, [315, [316, [317, [318, [319, [320, [321, [322, [323, [324, [325, [326, [327, [328, [329, [330, [331, [332, [333, [334, [335, [336, [337, [338, [339, [340, [341, [342, [343, [344, [345, [346, [347, [348, [349, [350, [351, [352, [353, [354, [355, [356, [357, [358, [359, [360, [361, [362, [363, [364, [365, [366, [367, [368, [369, [370, [371, [372, [373, [374, [375, [376, [377, [378, [379, [380, [381, [382, [383, [384, [385, [386, [387, [388, [389, [390, [391, [392, [393, [394, [395, [396, [397, [398, [399, [400, [401, [402, [403, [404, [405, [406, [407, [408, [409, [410, [411, [412, [413, [414, [415, [416, [417, [418, [419, [420, [421, [422, [423, [424, [425, [426, [427, [428, [429, [430, [431, [432, [433, [434, [435, [436, [437, [438, [439, [440, [441, [442, [443, [444, [445, [446, [447, [448, [449, [450, [451, [452, [453, [454, [455, [456, [457, [458, [459, [460, [461, [462, [463, [464, [465, [466, [467, [468, [469, [470, [471, [472, [473, [474, [475, [476, [477, [478, [479, [480, [481, [482, [483, [484, [485, [486, [487, [488, [489, [490, [491, [492, [493, [494, [495, [496, [497, [498, [499, [500, [501, [502, [503, [504, [505, [506, [507, [508, [509, [510, [511, [512, [513, [514, [515, [516, [517, [518, [519, [520, [521, [522, [523, [524, [525, [526, [527, [528, [529, [530, [531, [532, [533, [534, [535, [536, [537, [538, [539, [540, [541, [542, [543, [544, [545, [546, [547, [548, [549, [550, [551, [552, [553, [554, [555, [556, [557, [558, [559, [560, [561, [562, [563, [564, [565, [566, [567, [568, [569, [570, [571, [572, [573, [574, [575, [576, [577, [578, [579, [580, [581, [582, [583, [584, [585, [586, [587, [588, [589, [590, [591, [592, [593, [594, [595, [596, [597, [598, [599, [600, [601, [602, [603, [604, [605, [606, [607, [608, [609, [610, [611, [612, [613, [614, [615, [616, [617, [618, [619, [620, [621, [622, [623, [624, [625, [626, [627, [628, [629, [630, [631, [632, [633, [634, [635, [636, [637, [638, [639, [640, [641, [642, [643, [644, [645, [646, [647, [648, [649, [650, [651, [652, [653, [654, [655, [656, [657, [658, [659, [660, [661, [662, [663, [664, [665, [666, [667, [668, [669, [670, [671, [672, [673, [674, [675, [676, [677, [678, [679, [680, [681, [682, [683, [684, [685, [686, [687, [688, [689, [690, [691, [692, [693, [694, [695, [696, [697, [698, [699, [700, [701, [702, [703, [704, [705, [706, [707, [708, [709, [710, [711, [712, [713, [714, [715, [716, [717, [718, [719, [720, [721, [722, [723, [724, [725, [726, [727, [728, [729, [730, [731, [732, [733, [734, [735, [736, [737, [738, [739, [740, [741, [742, [743, [744, [745, [746, [747, [748, [749, [750, [751, [752, [753, [754, [755, [756, [757, [758, [759, [760, [761, [762, [763, [764, [765, [766, [767, [768, [769, [770, [771, [772, [773, [774, [775, [776, [777, [778, [779, [780, [781, [782, [783, [784, [785, [786, [787, [788, [789, [790, [791, [792, [793, [794, [795, [796, [797, [798, [799, [800, [801, [802, [803, [804, [805, [806, [807, [808, [809, [810, [811, [812, [813, [814, [815, [816, [817, [818, [819, [820, [821, [822, [823, [824, [825, [826, [827, [828, [829, [830, [831, [832, [833, [834, [835, [836, [837, [838, [839, [840, [841, [842, [843, [844, [845, [846, [847, [848, [849, [850, [851, [852, [853, [854, [855, [856, [857, [858, [859, [860, [861, [862, [863, [864, [865, [866, [867, [868, [869, [870, [871, [872, [873, [874, [875, [876, [877, [878, [879, [880, [881, [882, [883, [884, [885, [886, [887, [888, [889, [890, [891, [892, [893, [894, [895, [896, [897, [898, [899, [900, [901, [902, [903, [904, [905, [906, [907, [908, [909, [910, [911, [912, [913, [914, [915, [916, [917, [918, [919, [920, [921, [922, [923, [924, [925, [926, [927, [928, [929, [930, [931, [932, [933, [934, [935, [936, [937, [938, [939, [940, [941, [942, [943, [944, [945, [946, [947, [948, [949, [950, [951, [952, [953, [954, [955, [956, [957, [958, [959, [960, [961, [962, [963, [964, [965, [966, [967, [968, [969, [970, [971, [972, [973, [974, [975, [976, [977, [978, [979, [980, [981, [982, [983, [984, [985, [986, [987, [988, [989, [990, [991, [992, [993, [994, [995, [996, [997, [998, [999]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
```
Both versions also gracefully accept negative numbers
```
p r[-5] # => []
```
[Answer]
# PHP 5.4 (67 bytes):
I know, I know.
It's far from being the shortest answer.
But it works!
Here it is:
```
function F($n){for($c=$n?[--$n]:[];~$n&&$n--;$c=[$n,$c]);return$c;}
```
You can test it right here: <https://ideone.com/42L35E> (ignore the error)
---
# Javascript (57 bytes):
This is the **same** **exact** **code** except that Javascript is picky about the return and I've reduced the variable names:
```
function F(n){for(c=n?[--n]:[];~n&&n--;c=[n,c]);return c}
```
See? Same code!
---
# ES6 (49 bytes):
Basically the same exact code, but reduced for ES6:
```
F=n=>{for(c=n?[--n]:[];~n&&n--;c=[n,c]);return c}
```
[Answer]
# Javascript (114 bytes):
Everybody else was doing recursive, so I wanted to try an iterative solution. I have too many special cases, though.
I hold a master list, and then loop and append new lists with new numbers.
```
function q(n){a=[];if(n==1)a=[0];else if(n!=0){a=[0,b=[]];for(i=1;i<n;){c=[];b.push(c);b.push(i++);b=c}}return a}
```
[Answer]
# Common Lisp (95 bytes):
```
(defun f(n &optional(i 0))(cond((< i(1- n))(cons i(list(f n(1+ i)))))((> n 0)(list i))(t nil)))
```
[Answer]
# JavaScript, ~~35~~ 37 bytes
Recursive solution
```
f=(n,x=[])=>n?f(--n,x[0]?[n,x]:[n]):x
```
[Try it online!](https://tio.run/##DcexCsMgEADQX3H04AxpBqEBm71DO3QUh5B6IUXugkpJv95merzP/J3Lkre9GpZ3bI2cZjycD@BuPJE25qzvw@RPw@g5wHg0kqx0ilWxElK@xwsOaHGwaK8B1CJcJMUuyarvr@ejKzVvvG7006QZANof)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 11 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
_i¯ëFNI<α)R
```
[Try it online](https://tio.run/##yy9OTMpM/f/fzc/T5txGzaD//80A) or [verify all test cases](https://tio.run/##yy9OTMpM/V9WeXiCS6i9ksKjtkkKSvb/4zMPrT@82s0vwubcRs2g/7W1OjH/ow10FAx1FIx0FMyAJBCbWcYCAA).
11-bytes alternative:
```
_i¯ëÝ¨Rvy)R
```
[Try it online](https://tio.run/##yy9OTMpM/f8/PvPQ@sOrD889tCKorFIz6P9/MwA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9WeXiCS6i9ksKjtkkKSvb/4zMPrT@8@vDcQyuCyio1g/7X1urE/I820FEw1FEw0lEwA5JAbGYZCwA).
**Explanation:**
05AB1E has no loops that go downwards, so to loop in the range `(input, 0]` I either have to:
* Create that range first (`Ý¨R`; create range `[0, input]`, remove last item, reverse), and then loop over it (`vy`);
* Or loop in the range `[0, input)` instead (`F`), and take the absolute difference between the loop-index and the input-1 (`NI<α`).
```
_i          # If the (implicit) input is 0:
  ¯         #  Push the global array (empty by default)
 ë          # Else:
  F         #  Loop `N` in the range [0, (implicit) input):
   N        #   Push index `N`
    I<      #   Push input-1
      α     #   Take the absolute difference between the two
       )    #   Wrap everything on the stack into a list
        R   #   Reverse the list
            # (output the result implicitly after the if/loop)
```
]