%I #11 Nov 22 2023 10:08:34
%S 0,11,278,202040,107371882880,30324991112647875920960,
%T 2418916677393691552133618294938847890243982720,
%U 15390805926573768302084260548391044837412074858741153833336080616936611834819590898337488640
%N The natural numbers represented by their set theoretic Von Neumann construction, where the empty set is replaced by '0', the left set bracket '{' is replaced by 1, the right bracket '}' is replaced by 2, the set construct contents are ordered by increasing cardinality and the final number is interpreted in base 3.
%F S(n) = n union {n}.
%e a(0)=0=0_3=0, a(1)={0}=102_3=11, a(2)={0,{0}}=101022_3=278, etc.
%p N:=proc(n) local i,s,l,r,data; s:=`0`;l:=`1`;r:=`2`; if n>0 then for i from 1 to n-1 do s:=cat(s,l,s,r); od; s:=cat(l,s,r); fi; data:=sscanf(s,`%d`); RETURN(data[1]); end: b3tob10:=proc(n) local i,nl,sl,suma; if n=0 then suma:=0; else sl:=convert(n,base,10); nl:=convert(sl,base,3,10); suma:=sum(nl[i]*10^(i-1),i=1..nops(nl)); fi; RETURN(suma); end: for n from 0 to 7 do b3tob10(N(n)); od;
%t Join[{0},Map[FromDigits[#,3]&,NestList["1"<>StringTake[#,{2,-2}]<>#<>"2"&,"102",8]]] (* _Paolo Xausa_, Nov 22 2023 *)
%Y Cf. A129751.
%K easy,nonn,base
%O 0,2
%A I.N. Galidakis (jgal(AT)ath.forthnet.gr), May 14 2007
%E Missing a(0) inserted by _Paolo Xausa_, Nov 22 2023