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!)
A050493 a(n) = sum of binary digits of n-th triangular number. 2

%I #27 May 28 2021 13:34:12

%S 0,1,2,2,2,4,3,3,2,4,5,2,4,5,4,4,2,4,5,6,4,6,7,3,4,4,7,6,5,6,5,5,2,4,

%T 5,6,5,8,6,4,5,7,6,6,8,4,5,4,4,5,8,6,5,7,7,3,6,7,8,7,6,7,6,6,2,4,5,6,

%U 5,8,7,8,4,6,8,5,8,9,4,5,5,8,7,8,8,7,8,8,7,8,12,5,6,5,6,5,4,5,8,7,8

%N a(n) = sum of binary digits of n-th triangular number.

%C See A211201 for smallest numbers m such that a(m) = n. - _Reinhard Zumkeller_, Feb 04 2013

%H T. D. Noe, <a href="/A050493/b050493.txt">Table of n, a(n) for n = 0..1024</a>

%H <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = Sum_{i=1..floor(log_b(c(n)))+1} (floor(c(n)/b^(i-1)) - floor(c(n)/b^i)*b), b=2, n >= 1, a(0)=0, c(n)=A000217(n).

%F a(n) = A000120(A000217(n)). - _Reinhard Zumkeller_, Feb 04 2013

%F a(n) = [x^(n*(n+1)/2)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - _Ilya Gutkovskiy_, Mar 27 2018

%t f[n_]:=Plus@@IntegerDigits[n,2]; lst={};Do[t=n*(n+1)/2;AppendTo[lst,f[t]],{n,6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Oct 10 2009 *)

%t Total[IntegerDigits[#,2]]&/@Accumulate[Range[0,100]] (* _Harvey P. Dale_, Jan 22 2012 *)

%o (Haskell)

%o a050493 = a000120 . a000217 -- _Reinhard Zumkeller_, Feb 04 2013

%o (PARI) a(n)=hammingweight(n*(n+1)) \\ _Charles R Greathouse IV_, Nov 10 2015

%Y Cf. A000120, A000217, A004157.

%K base,easy,nice,nonn

%O 0,3

%A Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 27 1999

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 02:10 EDT 2024. Contains 371906 sequences. (Running on oeis4.)