OFFSET
0,3
COMMENTS
A set-theory analog of A121216.
This is a permutation of the nonnegative numbers.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..16384 (a(n) for n = 0..748 by N. J. A. Sloane)
MAPLE
read(transforms) : # ANDnos def'd here
A353708 := proc(n)
option remember;
local c, i, known ;
if n <= 2 then
n;
else
for c from 1 do
known := false ;
for i from 1 to n-1 do
if procname(i) = c then
known := true;
break ;
end if;
end do:
if not known and ANDnos(c, procname(n-2)) =0 then
return c;
end if;
end do:
end if;
end proc: # Following R. J. Mathar's program for A109812.
[seq(A353708(n), n=0..256)] ;
# second Maple program:
b:= proc() false end: t:= 2:
a:= proc(n) option remember; global t; local k; if n<2 then n
else for k from t while b(k) or Bits[And](k, a(n-2))>0
do od; b(k):=true; while b(t) do t:=t+1 od; k fi
end:
seq(a(n), n=0..100); # Alois P. Heinz, May 06 2022
MATHEMATICA
nn = 87; c[_] = -1; a[0] = c[0] = 0; a[1] = c[1] = 1; u = 2; Do[k = u; While[Nand[c[k] == -1, BitAnd[a[n - 2], k] == 0], k++]; Set[{a[n], c[k]}, {k, n}]; If[k == u, While[c[u] > -1, u++]], {n, 2, nn}]; Array[a, nn + 1, 0] (* Michael De Vlieger, May 06 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 06 2022
STATUS
approved