OFFSET
1,2
COMMENTS
a(n) is the n-th position where the sequence A392736 equals 0. For any balanced binary sequence, the odious and evil enumerators u(n), v(n) satisfy u(n) + v(n) = 4n + 1.
FORMULA
A392737(n) + a(n) = 4n + 1.
EXAMPLE
a(1) = 0 because A392736 = 0,1,1,0,1,... and the first 0 is at position 0.
MATHEMATICA
M[0] = 0; M[1] = 1; M[n_] := M[n] = Which[Mod[n, 4] == 0, M[Quotient[n, 4]], Mod[n, 4] == 1, 1 - M[Quotient[n, 4]], Mod[n, 4] == 2, M[2*Quotient[n, 4] + 1 - M[Quotient[n, 4]]], True, 1 - M[2*Quotient[n, 4] + 1 - M[Quotient[n, 4]]]]; Select[Range[0, 120], M[#] == 0 &]
PROG
(PARI) M(n) = if(n<2, n, my(q=n\4, r=n%4); if(r==0, M(q), r==1, 1-M(q), r==2, M(2*q+1-M(q)), 1-M(2*q+1-M(q))));
a(n) = my(k=0, c=0); while(c<n, if(M(k)==0, c++); if(c<n, k++)); k;
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John M. Campbell and Benoit Cloitre, Jan 21 2026
EXTENSIONS
a(51) onward corrected by Sean A. Irvine, Jan 25 2026
STATUS
approved
