login
A270804
0 followed by the positions of the 1's in the inverse Thue-Morse sequence A270803.
1
0, 1, 2, 7, 8, 9, 10, 31, 32, 33, 34, 39, 40, 41, 42, 127, 128, 129, 130, 135, 136, 137, 138, 159, 160, 161, 162, 167, 168, 169, 170, 511, 512, 513, 514, 519, 520, 521, 522, 543, 544, 545, 546, 551, 552, 553, 554, 639, 640, 641, 642, 647, 648, 649, 650, 671, 672, 673, 674, 679, 680, 681, 682, 2047
OFFSET
0,3
LINKS
Maciej Gawron, and Maciej Ulas, On formal inverse of the Prouhet-Thue-Morse sequence, Discrete Mathematics 339.5 (2016): 1459-1470. Also arXiv preprintarXiv:1601.04840 [math.CO], 2016.
FORMULA
See Maple code.
MAPLE
a:=proc(n) option remember;
if n<=2 then n
elif n=3 then 7
else if n mod 4 = 0 then a(n-1)+1
elif n mod 4 = 1 then a(n-2)+2
elif n mod 4 = 2 then a(n-3)+3
elif n mod 8 = 3 then a(n-3)+7
else 4*a((n-1)/2)+3; fi;
fi;
end;
[seq(a(n), n=0..120)];
MATHEMATICA
a[n_] := a[n] = Which[n <= 2, n, n == 3, 7, True, Which[Mod[n, 4] == 0, a[n - 1] + 1, Mod[n, 4] == 1, a[n - 2] + 2, Mod[n, 4] == 2, a[n - 3] + 3, Mod[n, 8] == 3, a[n - 3] + 7, True, 4*a[(n - 1)/2] + 3]];
Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Dec 03 2017, from Maple *)
CROSSREFS
Sequence in context: A283565 A047527 A064517 * A167457 A287515 A260581
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 02 2016
EXTENSIONS
Perhaps someone could enter the sequences d_n, z_n, u_n given in Section 4 of the article (unless of course they are already in the OEIS).
STATUS
approved