OFFSET
0,2
COMMENTS
If brackets are interpreted as 90-degree turns, and left bracket is turn left and go forward 1 unit, right bracket is turn right and go forward 1 unit, then a Levy C curve is drawn.
EXAMPLE
For n=3, Von Neumann's 3-element set {0, 1, 2} is
{ {}, {{}}, {{},{{}}} }
0 01 0011 001 00111 1 binary = a(3) = 9807
MATHEMATICA
With[{nmax=8}, Map[FromDigits[#, 2]&, NestList["0"<>StringTake[#, {2, -2}]<>#<>"1"&, "01", nmax]]] (* Paolo Xausa, Nov 20 2023 *)
PROG
(PARI) a(n) = my(k = 1); for(m = 1, n, k = (k-1)*2^(2^m)+2*k+1); k; \\ Thomas Scheuerle, Nov 21 2023
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
CROSSREFS
KEYWORD
nonn,base,easy,changed
AUTHOR
Stuart E Anderson, Nov 20 2023
EXTENSIONS
a(7) from Paolo Xausa, Nov 20 2023
Offset corrected by Kevin Ryde, Dec 24 2023
STATUS
approved