[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A050493
a(n) = sum of binary digits of n-th triangular number.
2
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, 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, 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
OFFSET
0,3
COMMENTS
See A211201 for smallest numbers m such that a(m) = n. - Reinhard Zumkeller, Feb 04 2013
FORMULA
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).
a(n) = A000120(A000217(n)). - Reinhard Zumkeller, Feb 04 2013
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
MATHEMATICA
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 *)
Total[IntegerDigits[#, 2]]&/@Accumulate[Range[0, 100]] (* Harvey P. Dale, Jan 22 2012 *)
PROG
(Haskell)
a050493 = a000120 . a000217 -- Reinhard Zumkeller, Feb 04 2013
(PARI) a(n)=hammingweight(n*(n+1)) \\ Charles R Greathouse IV, Nov 10 2015
CROSSREFS
KEYWORD
base,easy,nice,nonn
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 27 1999
STATUS
approved