|
Search: id:A070939
|
|
|
| A070939 |
|
Length of binary representation of n. |
|
+0 70
|
|
| 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
(list; graph; listen)
|
|
|
OFFSET
|
0,3
|
|
|
COMMENT
|
Zero is assumed to be represented as 0.
For n>1, n appears 2^(n-1) times. - Lekraj Beedassy (blekraj(AT)yahoo.com), Apr 12 2006
a(n) is the permanent of the n X n 0-1 matrix whose (i,j) entry is 1 iff i=1 or i=j or i=2*j. For example, a(4)=3 is per([[1, 1, 1, 1], [1, 1, 0, 0], [0, 0, 1, 0], [0, 1, 0, 1]]). - David Callan (callan(AT)stat.wisc.edu), Jun 07 2006
|
|
REFERENCES
|
G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
|
|
LINKS
|
T. D. Noe, Table of n, a(n) for n = 0..1024
R. Stephan, Some divide-and-conquer sequences ...
R. Stephan, Table of generating functions
R. Stephan, Divide-and-conquer generating functions. I. Elementary sequences
Index entries for "core" sequences
Index entries for sequences related to binary expansion of n
|
|
FORMULA
|
a(0) = 1; for n >= 1, a(n) = 1 + floor(log_2(n)) = 1 + A000523(n).
G.f.: 1 + 1/(1-x) * Sum(k>=0, x^2^k). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Apr 12 2002
a(0)=1, a(1)=1 and a(n)=1+a(floor(n/2)) - Benoit Cloitre (benoit7848c(AT)orange.fr), Dec 02 2003
a(n) = A000120(n) + A023416(n). - Lekraj Beedassy (blekraj(AT)yahoo.com), Apr 12 2006
|
|
EXAMPLE
|
8 = 1000 in binary has length 4.
|
|
MAPLE
|
A070939 := proc(n); Digits := 20: if n=0 then 1 else 1+floor(evalf(0.0000001 + log(n)/log(2))); fi; end;
|
|
MATHEMATICA
|
Table[Length[IntegerDigits[n, 2]], {n, 0, 50}] - Stefan Steinerberger (stefan.steinerberger(AT)gmail.com), Apr 01 2006
|
|
PROGRAM
|
(PARI) a(n)=if(n<1, n==0, floor(log(n)/log(2))+1)
|
|
CROSSREFS
|
Cf. A070940, A070941, A001511, A000523.
A029837(n+1) gives the length of binary representation of n without the leading zeros (i.e. when zero is represented as the empty sequence). For n>0 this is equal to a(n).
This is Guy Steele's sequence GS(4, 4) (see A135416).
Adjacent sequences: A070936 A070937 A070938 this_sequence A070940 A070941 A070942
Sequence in context: A072660 A075172 A029837 this_sequence A113473 A122027 A112751
|
|
KEYWORD
|
nonn,easy,nice,core
|
|
AUTHOR
|
N. J. A. Sloane (njas(AT)research.att.com), May 18 2002
|
|
EXTENSIONS
|
a(4) corrected by Antti Karttunen, Feb 28 2003
|
|
|
Search completed in 0.005 seconds
|