login
A189138
Zero-one sequence based on the sequence 1+n^2: a(A002522(k))=a(k); a(A164386(k))=1-a(k), a(1)=0.
3
1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1
OFFSET
1
MATHEMATICA
u[n_] := 1+n^2; (*A002522*)
a[1] = 0; h = 128;
c = (u[#1] &) /@ Range[2h];
d = (Complement[Range[Max[#1]], #1] &)[c]; (*A164386*)
Table[a[d[[n]]] = 1 - a[n], {n, 1, h - 1}]; (*A189138*)
Table[a[c[[n]]] = a[n], {n, 1, h}] (*A189138*)
Flatten[Position[%, 0]] (*A189139*)
Flatten[Position[%%, 1]] (*A189140*)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Apr 17 2011
STATUS
approved