|
|
A088236
|
|
Total number of digits (in base 2) in all preceding terms in the sequence.
|
|
2
|
|
|
0, 1, 2, 4, 7, 10, 14, 18, 23, 28, 33, 39, 45, 51, 57, 63, 69, 76, 83, 90, 97, 104, 111, 118, 125, 132, 140, 148, 156, 164, 172, 180, 188, 196, 204, 212, 220, 228, 236, 244, 252, 260, 269, 278, 287, 296, 305, 314, 323, 332, 341, 350, 359, 368, 377, 386, 395
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
a(n+1) = a(n) + floor(Log(2, a(n))) + 1, with a(0) = 0, a(1) = 1.
|
|
MAPLE
|
A070939 := n -> `if`(n=0, 1, ilog2(2*n)):
A088236 := proc(n) option remember;
if n=0 then 1
|
|
MATHEMATICA
|
a[n_]:= a[n]= If[n<2, n, a[n-1] + Floor[Log2[a[n-1]]] +1];
Table[a[n], {n, 0, 100}] (* G. C. Greubel, Dec 10 2015; Jul 24 2022 *)
|
|
PROG
|
(PARI) alist(n) = my(r=vector(n), val=0, delta=1, pow=2); for(i=2, n, r[i]=val+=delta; if(val>=pow, delta++; pow*=2)); r \\ Franklin T. Adams-Watters, Oct 11 2014
(SageMath)
@CachedFunction
def a(n): return n if (n<2) else a(n-1) + floor(log(a(n-1), 2)) + 1 # a = A088236
(Python)
from itertools import islice
def agen():
yield 0; an = 1
while True: yield an; an += an.bit_length()
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
David Corbett (dcorbett42(AT)yahoo.co.nz), Sep 25 2003
|
|
STATUS
|
approved
|
|
|
|