|
Search: id:A000523
|
|
|
| A000523 |
|
Log_2(n) rounded down. |
|
+0 80
|
|
| 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
(list; graph; listen)
|
|
|
OFFSET
|
1,4
|
|
|
COMMENT
|
Or, n-1 appears 2^(n-1) times. - Jon Perry (perry(AT)globalnet.co.uk), Sep 21 2002
a(n) + 1 = number of bits in binary expansion of n.
Largest power of 2 dividing LCM[1..n]: A007814[A003418(n)].
Log_2(0) = -infinity.
Also max(Omega(k): 1<=k<=n), where Omega(n)=A001222(n), number of prime factors with repetition; see A080613. - Reinhard Zumkeller (reinhard.zumkeller(AT)lhsystems.com), Feb 25 2003
a(n+1) = number of digits of n-th number with no 0 in ternary representation = A081604(A032924(n)); A107680(n) = A003462(a(n+1)). - Reinhard Zumkeller (reinhard.zumkeller(AT)lhsystems.com), May 20 2005
|
|
REFERENCES
|
G. H. Hardy, Note on Dr. Vacca's series..., Quart. J. Pure Appl. Math. 43 (1912) 215-216.
D. E. Knuth, The Art of Computer Programming, Vol. 1: Fundamental Algorithms, p. 400.
|
|
LINKS
|
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
R. Stephan, Some divide-and-conquer sequences ...
R. Stephan, Table of generating functions
|
|
FORMULA
|
a(n) = if n > 1 then a(floor(n / 2)) + 1 else 0. - Reinhard Zumkeller (reinhard.zumkeller(AT)lhsystems.com), Oct 29 2001
G.f.: 1/(1-x) * Sum(k>=1, x^2^k). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Apr 13 2002
|
|
EXAMPLE
|
a(5)=2 because the binary expansion of 5 (=101) has three bits.
|
|
MAPLE
|
A000523 := n->floor(simplify(log(n)/log(2)));
A000523 := proc(n) local nn, i; if(0 = n) then RETURN(-infinity); fi; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
|
|
PROGRAM
|
(MAGMA) [Ilog2(n) : n in [1..130] ];
(PARI) a(n)=if(n<1, 0, floor(log(n)/log(2)))
|
|
CROSSREFS
|
Cf. A029837. Partial sums: A061168.
a(n) = A070939(n)-1 for n>=1.
Adjacent sequences: A000520 A000521 A000522 this_sequence A000524 A000525 A000526
Sequence in context: A072750 A029835 A074280 this_sequence A124156 A072749 A066490
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
njas
|
|
EXTENSIONS
|
Error in 4th term, pointed out by Joe Keane (jgk(AT)jgk.org), has been corrected.
More terms from Michael Somos, Aug 02, 2002
|
|
|
Search completed in 0.003 seconds
|