login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A248057
Positions of 1,1 in the Thue-Morse sequence (A010060).
4
2, 8, 14, 22, 26, 32, 38, 42, 50, 56, 62, 70, 74, 82, 88, 94, 98, 104, 110, 118, 122, 128, 134, 138, 146, 152, 158, 162, 168, 174, 182, 186, 194, 200, 206, 214, 218, 224, 230, 234, 242, 248, 254, 262, 266, 274, 280, 286, 290, 296, 302, 310, 314, 322, 328
OFFSET
1,1
COMMENTS
Every positive integer lies in exactly one of these four sequences: A248056, A091855, A091855, A248057.
LINKS
FORMULA
a(n) = 2*A091855(n) for n >= 1.
EXAMPLE
Thue-Morse sequence: 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,..., so that a(1) = 2 and a(2) = 8.
MATHEMATICA
z = 400; u = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 9] (* A010060 *)
v = Rest[u]
t1 = Table[If[u[[n]] == 0 && v[[n]] == 0, 1, 0], {n, 1, z}];
t2 = Table[If[u[[n]] == 0 && v[[n]] == 1, 1, 0], {n, 1, z}];
t3 = Table[If[u[[n]] == 1 && v[[n]] == 0, 1, 0], {n, 1, z}];
t4 = Table[If[u[[n]] == 1 && v[[n]] == 1, 1, 0], {n, 1, z}];
Flatten[Position[t1, 1]] (* A248056 *)
Flatten[Position[t2, 1]] (* A091855 *)
Flatten[Position[t3, 1]] (* A091785 *)
Flatten[Position[t4, 1]] (* A248057 *)
SequencePosition[ThueMorse[Range[400]], {1, 1}][[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 16 2017 *)
PROG
(PARI) t(n)=hammingweight(n)%2;
for(n=1, 500, if(t(n)==1&&t(n-1)==1, print1(n, ", "))); \\ Joerg Arndt, Mar 12 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Sep 30 2014
STATUS
approved