OFFSET
0,2
REFERENCES
Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
S. Brlek, Enumeration of factors in the Thue-Morse word, Discrete Applied Math. 24 (1989), 83-96.
A. de Luca and S. Varricchio, Some combinatorial properties of the Thue-Morse sequence and a problem in semigroups, Theoret. Comput. Sci. 63 (1989), 333-348.
FORMULA
MAPLE
ph:=proc(n) option remember;
if n=2 then 2 elif n<=3 then n+1 else if n mod 2 = 0 then ph(n/2) else ph((n+1)/2); fi;
fi; end;
MATHEMATICA
ph[n_] := ph[n] = If[n == 2, 2, If[n <= 3, n+1, If[Mod[n, 2] == 0, ph[n/2], ph[(n+1)/2]]]];
ph /@ Range[0, 120] (* Jean-François Alcover, Jun 18 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 10 2012
EXTENSIONS
Name clarified by Michel Dekking, Sep 28 2020
STATUS
approved