Hide
Problem J
Ordinals
The Von Neumann ordinals are a number system. Ordinal numbers can be represented as sets of all numbers less than that number:
\[ \begin{aligned} 0 & = \varnothing & =& \ \{ \} \\ 1 & = \{ 0\} & =& \ \{ \{ \} \} \\ 2 & = \{ 0,1\} & =& \ \{ \{ \} ,\{ \{ \} \} \} \\ 3 & = \{ 0,1,2\} & =& \ \{ \{ \} ,\{ \{ \} \} ,\{ \{ \} ,\{ \{ \} \} \} \} \\ & \vdots \end{aligned} \]Input
Input consists of a single integer $0 \le n \le 8$.
Output
The output is the representation of that number as a set as specified above.
Sample Input 1 | Sample Output 1 |
---|---|
0 |
{} |
Sample Input 2 | Sample Output 2 |
---|---|
1 |
{{}} |
Sample Input 3 | Sample Output 3 |
---|---|
2 |
{{},{{}}} |