A285779 Parity index: number of integers z with 1 <= z <= n for which A010060(z) = A010060(n), negated if A010060(n) = 1.
0, -1, -2, 1, -3, 2, 3, -4, -5, 4, 5, -6, 6, -7, -8, 7, -9, 8, 9, -10, 10, -11, -12, 11, 12, -13, -14, 13, -15, 14, 15, -16, -17, 16, 17, -18, 18, -19, -20, 19, 20, -21, -22, 21, -23, 22, 23, -24, 24, -25, -26, 25, -27, 26, 27, -28, -29, 28, 29, -30, 30, -31, -32, 31, -33, 32, 33, -34, 34, -35, -36, 35, 36
Offset: 0
Links
Programs
-
Mathematica
Function[s, Table[(2 Boole[# == 0] - 1) Count[Take[s, n], z_ /; z == #] &@ s[[n]], {n, 0, Length@ s}]]@ Array[ThueMorse, 72] (* Michael De Vlieger, May 10 2017, Version 10.2 *)
-
PARI
a(n) = {my(v = 1); forstep(b = length(binary(n)) - 1, 0, -1, if(bittest(n, b), v = bitxor(-v, 2^b)); ); v = bitnegimply(v, 1); return(v / 2)}
Comments