login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
else A088236(n-1) + A070939(A088326(n-1)); fi;
end proc; # N. J. A. Sloane, Aug 30 2022
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
[a(n) for n in (0..100)] # G. C. Greubel, Jul 24 2022
(Python)
from itertools import islice
def agen():
yield 0; an = 1
while True: yield an; an += an.bit_length()
print(list(islice(agen(), 57))) # Michael S. Branicky, Jul 24 2022
CROSSREFS
Sequence in context: A225249 A214048 A328659 * A194244 A014616 A184674
KEYWORD
base,easy,nonn
AUTHOR
David Corbett (dcorbett42(AT)yahoo.co.nz), Sep 25 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:27 EDT 2024. Contains 371913 sequences. (Running on oeis4.)