The title is valid Jelly Code which has the same output as L€€
except printed twice.
Background
You can skip this section without losing ability to complete the challenge
Some operations in Jelly try to convert its argument to a list first before applying the operation. One example is €
, the mapping quick. This sometimes leads to unintended output.
For the program L€
and input 5, the Jelly interpreter tries to find the length of every element of the list 5. Since 5 is not a list, Jelly converts it to the list [1,2,3,4,5]. Then the length of every element is output: [1,1,1,1,1]
. Note that every integer has length 1
. If e.g. 10
was present, it would become 1
, not 2
(the length in digits).
For the program L€€
and input 5, the Jelly interpreter tries to find the length of every element of every element of the list 5. Since 5 is not a list, Jelly converts it to the list [1,2,3,4,5]
. Now the interpreter tries to find the length of every element of every element of the list [1,2,3,4,5]
. Every element is not a list, so Jelly converts them to lists in the same manner: [[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5]]
. The length of every sub-element is output as [[1],[1,1],[1,1,1],[1,1,1,1],[1,1,1,1,1]]
Task
Your task is to find the output of the Jelly program L
followed by €
repeated a
times, with input b
, where a
and b
are positive integers equal to your program/function's inputs.
A way to do this is:
Starting with the input b
, do the following a
times:
- For every integer that the program sees, replace it with the range of the integer (where
range(x) := [1,2,3,...,x-1,x]
)
Finally, replace every integer with 1.
Test Cases
a
b
output
- - - - -
1
1
[1]
- - - - -
1
2
[1, 1]
- - - - -
1
3
[1, 1, 1]
- - - - -
1
4
[1, 1, 1, 1]
- - - - -
1
5
[1, 1, 1, 1, 1]
- - - - -
1
6
[1, 1, 1, 1, 1, 1]
- - - - -
2
1
[[1]]
- - - - -
2
2
[[1], [1, 1]]
- - - - -
2
3
[[1], [1, 1], [1, 1, 1]]
- - - - -
2
4
[[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]
- - - - -
2
5
[[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]
- - - - -
2
6
[[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]
- - - - -
3
1
[[[1]]]
- - - - -
3
2
[[[1]], [[1], [1, 1]]]
- - - - -
3
3
[[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]
- - - - -
3
4
[[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]
- - - - -
3
5
[[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]
- - - - -
3
6
[[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]]
- - - - -
4
1
[[[[1]]]]
- - - - -
4
2
[[[[1]]], [[[1]], [[1], [1, 1]]]]
- - - - -
4
3
[[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]
- - - - -
4
4
[[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]]
- - - - -
4
5
[[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]]
- - - - -
4
6
[[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]]]
- - - - -
5
1
[[[[[1]]]]]
- - - - -
5
2
[[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]]
- - - - -
5
3
[[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]]
- - - - -
5
4
[[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]]]
- - - - -
5
5
[[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]]]
- - - - -
5
6
[[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]]]]
- - - - -
6
1
[[[[[[1]]]]]]
- - - - -
6
2
[[[[[[1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]]]
- - - - -
6
3
[[[[[[1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]]]
- - - - -
6
4
[[[[[[1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]]]]
- - - - -
6
5
[[[[[[1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]]]]
- - - - -
6
6
[[[[[[1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]]], [[[[[1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]]], [[[[1]]], [[[1]], [[1], [1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]]], [[[1]], [[1], [1, 1]], [[1], [1, 1], [1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1]], [[1], [1, 1], [1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]]]]]
Rules
a
andb
are restricted to positive integers- Your program or function may take
a
andb
in any order and in any standard input format - The output should be a depth-a list or string representation of such a list
- The output should be returned through any standard output format.
- This is code-golf, so shortest code in each language wins!
1
, not the length of its decimal expansion? \$\endgroup\$L€€CH!DṬHỊṢṄ!
(or maybeL€€Ṅ
) btw... \$\endgroup\$