A212439 a(n) = 2*n + A181935(n) mod 2.
1, 3, 5, 6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 27, 29, 30, 32, 35, 37, 38, 40, 42, 45, 47, 49, 51, 52, 54, 56, 59, 61, 63, 65, 67, 69, 70, 72, 74, 77, 79, 81, 83, 85, 86, 88, 90, 93, 94, 96, 99, 101, 102, 104, 106, 108, 111, 113, 115, 116, 118, 120, 123, 125
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..8191
- 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
a212439 n = 2 * n + a212412 n
-
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]]; a[n_] := 2*n + Mod[Max[Table[f[n, e], {e, Range[Max[1, Floor[Log2[n]]]]}]], 2]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, Apr 08 2025 *)
Formula
a(n) = 2*n + A212412(n): concatenation of binary representation of n and the parity of its curling number.
Comments