OFFSET
1,2
COMMENTS
The 'crossings' that appear in the graph seem to occur when a(n) is a power of 2.
LINKS
Clément Vovard, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log-log scatterplot of a(n) for n = 1..2^16.
Michael De Vlieger, Log-log scatterplot of a(n) for n = 1..2^10 with color function registering binary weight of a(n-1).
Michael De Vlieger, Log-log scatterplot of a(n) for n = 1..2^10 with even n in red and odd n in blue.
FORMULA
a(n) = n - A011371(a(n-1)).
MATHEMATICA
a[1] = 1; a[n_] := a[n] = n + DigitCount[a[n - 1], 2, 1] - a[n - 1]; Array[a, 100] (* Amiram Eldar, Apr 12 2021 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = n + hammingweight(va[n-1]) - va[n-1]; ); va; } \\ Michel Marcus, Apr 12 2021
CROSSREFS
KEYWORD
AUTHOR
Clément Vovard, Apr 11 2021
STATUS
approved