A212444 Iterates A212439, starting from 0.
0, 1, 3, 6, 13, 27, 54, 108, 216, 433, 867, 1734, 3469, 6939, 13878, 27756, 55512, 111025, 222050, 444101, 888202, 1776404, 3552808, 7105617, 14211235, 28422470, 56844941, 113689883, 227379766, 454759532, 909519064, 1819038129, 3638076259, 7276152518
Offset: 0
Links
- Amiram Eldar, Table of n, a(n) for n = 0..1000 (terms 0..100 from Reinhard Zumkeller)
- Benjamin Chaffin, John P. Linderman, N. J. A. Sloane, and Allan R. Wilks, On Curling Numbers of Integer Sequences, Journal of Integer Sequences, Vol. 16 (2013), Article 13.4.3.
- Index entries for sequences related to binary expansion of n.
Programs
-
Haskell
a212444 n = a212444_list !! n a212444_list = iterate a212439 0
-
Mathematica
f[n_, e_] := Module[{d = IntegerDigits[n, 2^e]}, Length[Split[d][[-1]]] - If[SameQ @@ d && Mod[n, 2^e] < 2^(e - 1), 1, 0]]; s[n_] := 2*n + Mod[Max[Table[f[n, e], {e, Range[Max[1, Floor[Log2[n]]]]}]], 2]; s[0] = 1; NestList[s, 0, 33] (* Amiram Eldar, Apr 08 2025 *)