OFFSET
2,5
COMMENTS
Terms between 2^n and 2^(n+1) as n goes to infinity tend to the sequence : 0,1,2,1,2,3,2,1,2,3,2,3,4,3,2,1,2,3,2,3,4,3,2,3,4,3,4,5,4,3,2,1,....
LINKS
Michael De Vlieger, Table of n, a(n) for n = 2..16384
FORMULA
a(2^n) = 0; Sum_{k=2^n..2^(n+1)} a(k) = n*2^(n-1) = A001787(n).
MATHEMATICA
nn = 120; c[_] := False; j = 1; c[1] = True; Reap[Do[Set[k, If[c[n], j + 1, j + 3]]; Set[{a[n], c[k], j}, {k - 2 n, True, k}]; Sow[a[n]], {n, 2, nn}] ][[-1, -1]] (* Michael De Vlieger, Apr 29 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Oct 12 2003
STATUS
approved