login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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 and the set construct contents are ordered by increasing cardinality.
1

%I #14 Nov 22 2023 08:16:15

%S 0,102,101022,101021010222,101021010221010210102222,

%T 101021010221010210102221010210102210102101022222,

%U 101021010221010210102221010210102210102101022221010210102210102101022210102101022101021010222222

%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 and the set construct contents are ordered by increasing cardinality.

%H PlanetMath, <a href="http://planetmath.org/vonneumanninteger">von Neumann integer</a>

%e a(0)=0, a(1)={0}=102, a(2)={0,{0}}=101022, 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:

%t Join[{0},Map[FromDigits,NestList["1"<>StringTake[#,{2,-2}]<>#<>"2"&,"102",7]]] (* _Paolo Xausa_, Nov 22 2023 *)

%Y Cf. A129754.

%K easy,nonn,base

%O 0,2

%A I.N. Galidakis (jgal(AT)ath.forthnet.gr), May 14 2007