login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A029931 If 2n = Sum 2^e_i, a(n) = Sum e_i. 15
0, 1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 5, 6, 7, 8, 8, 9, 10, 11, 9, 10, 11, 12, 12, 13, 14, 15, 6, 7, 8, 9, 9, 10, 11, 12, 10, 11, 12, 13, 13, 14, 15, 16, 11, 12, 13, 14, 14, 15, 16, 17, 15, 16, 17, 18, 18, 19, 20, 21, 7, 8, 9, 10, 10, 11, 12, 13, 11, 12, 13, 14, 14, 15, 16 (list; graph; refs; listen; history; internal format)
OFFSET

0,3

COMMENTS

Write n in base 2, n = sum b(i)*2^(i-1), then a(n) = sum b(i)*i - Benoit Cloitre (benoit7848c(AT)orange.fr), Jun 09 2002

May be regarded as a triangular array read by rows, giving weighted sum of compositions in standard order. The standard order of compositions is given by A066099. - Franklin T. Adams-Watters (FrankTAW(AT)Netscape.net), Nov 06 2006

LINKS

T. D. Noe, Table of n, a(n) for n=0..1023

J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197, ex. 10.

FORMULA

a(n) =a(n-2^L(n))+L(n)+1 [where L(n)=floor[log_2(n)]=A000523(n)] = sum of digits of A048794 [at least for n<512] - Henry Bottomley (se16(AT)btinternet.com), Mar 09 2001

a(1)=0, a(2n) = a(n)+e1(n), a(2n+1) = a(2n)+1, where e1(n) = A000120(n). a(n) = log2(A029930(n)). - Ralf Stephan, Jun 19 2003

G.f. 1/(1-x) * sum(k>=0, (k+1)*x^2^k/(1+x^2^k)). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Jun 23 2003

a(n)=Sum_k>=0 {A030308(n,k)*A000027(k+1)}. - From DELEHAM Philippe, Oct 15 2011.

EXAMPLE

14 = 8+4+2 so a(7) = 3+2+1 = 6.

Composition number 11 is 2,1,1; 1*2+2*1+3*1 = 7, so a(11) = 7.

The triangle starts:

0

1

2 3

3 4 5 6

MATHEMATICA

a[n_] := (b = IntegerDigits[n, 2]).Reverse @ Range[Length @ b]; Array[a, 78, 0] (* From Jean-François Alcover, Apr 28 2011, after B. Cloitre *)

PROG

(PARI) for(n=0, 100, l=length(binary(n)); print1(sum(i=1, l, component(binary(n), i)*(l-i+1)), ", "))

CROSSREFS

Cf. A059867, A073642.

Other sequences that are built by replacing 2^k in the binary representation with other numbers: A089625 (primes), A059590 (factorials), A022290 (Fibonacci).

Cf. A066099, A070939, A124757, A011782 (row lengths), A001793 (row sums).

Sequence in context: A156562 A007998 A202704 * A022290 A185363 A103827

Adjacent sequences:  A029928 A029929 A029930 * A029932 A029933 A029934

KEYWORD

nonn,easy,nice,tabf

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from Erich Friedman (erich.friedman(AT)stetson.edu).

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 13:16 EST 2012. Contains 205795 sequences.