1
Write a program in any language that takes a single natural number n as input and generates a Pyth program that, in turn, produces, using nested lists, the nested set given by S(n), where:
S(0) = ∅
S(n+1) = S(n) ∪ {S(n)}
S(n) giving the set representation of the corresponding ordinal number.
Using the list representation required by this question, this gives (as the final output from the generated Pyth program):
0->[] 1->[[]] 2->[[],[[]]] 3->[[],[[]],[[],[[]]]]Etc.
Again, the challenge is to write a program in another language for generating the corresponding Pyth program.
This is code golf, so shortest full program wins.
Are the spaces in the output optional? – Martin Ender – 2015-05-06T15:30:43.303
The spaces in the final output (from the pyth program) are optional. – SuperJedi224 – 2015-05-06T15:34:11.363
The generating program takes the input though, the generated result isn't allowed to take any. – SuperJedi224 – 2015-05-06T15:46:37.657
1It'd be trivial to append something like
J<input>
at the front. – Sp3000 – 2015-05-06T15:49:51.193