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!)
A074330 a(n) = Sum_{k=1..n} 2^b(k) where b(k) denotes the number of 1's in the binary representation of k. 5

%I #22 Oct 29 2022 11:51:30

%S 2,4,8,10,14,18,26,28,32,36,44,48,56,64,80,82,86,90,98,102,110,118,

%T 134,138,146,154,170,178,194,210,242,244,248,252,260,264,272,280,296,

%U 300,308,316,332,340,356,372,404,408,416,424,440,448,464,480,512,520,536

%N a(n) = Sum_{k=1..n} 2^b(k) where b(k) denotes the number of 1's in the binary representation of k.

%H Robert Israel, <a href="/A074330/b074330.txt">Table of n, a(n) for n = 1..10000</a>

%H Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, p. 29.

%F a(n+1)-a(n) = A001316(n)

%F From _Ralf Stephan_, Oct 07 2003: (Start)

%F a(0)=0, a(2n) = 2a(n-1) + a(n) + 2, a(2n+1) = 3a(n) + 2.

%F G.f.: (1/(1-x)) * Product_{k>=0} (1 + 2x^2^k). (End)

%p f:= proc(n) option remember; if n::even then 2*procname(n/2-1)+procname(n/2)+2

%p else 3*procname((n-1)/2)+2

%p fi

%p end proc:

%p f(0):= 0:

%p map(f, [$1..100]); # _Robert Israel_, Oct 08 2020

%t b[n_] := IntegerDigits[n, 2] // Total;

%t a[n_] := 2^(b /@ Range[n]) // Total;

%t Array[a, 100] (* _Jean-François Alcover_, Aug 16 2022 *)

%o (PARI) a(n)=sum(i=1,n,2^sum(k=1,length(binary(i)), component(binary(i),k)))

%Y a(n) = A006046(n+1)-1. Cf. A080263.

%K easy,nonn

%O 1,1

%A _Benoit Cloitre_, Oct 06 2002

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 May 11 21:10 EDT 2024. Contains 372415 sequences. (Running on oeis4.)