cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A151920 a(n) = (Sum_{i=1..n+1} 3^wt(i))/3, where wt() = A000120().

Original entry on oeis.org

1, 2, 5, 6, 9, 12, 21, 22, 25, 28, 37, 40, 49, 58, 85, 86, 89, 92, 101, 104, 113, 122, 149, 152, 161, 170, 197, 206, 233, 260, 341, 342, 345, 348, 357, 360, 369, 378, 405, 408, 417, 426, 453, 462, 489, 516, 597, 600, 609, 618, 645, 654, 681, 708, 789, 798, 825, 852, 933, 960
Offset: 0

Views

Author

N. J. A. Sloane, Aug 05 2009, Aug 06 2009

Keywords

Comments

Partial sums of A147610 (but with offset changed to 0).
It appears that the first bisection gives the positive terms of A147562. - Omar E. Pol, Mar 07 2015

Examples

			n=3: (3^1+3^1+3^2+3^1)/3 = 18/3 = 6.
n=18: the binary expansion of 18+1 is 10011, i.e., 19 = 2^4 + 2^1 + 2^0.
The exponents of these powers of 2 (4, 1 and 0) reoccur as exponents in the powers of 4: a(19) = 3^0 * [(4^4 - 1) / 3 + 1] + 3^1 * [(4^1 - 1) / 3 + 1] + 3^2 * [(4^0 - 1)/3 + 1] = 1 * 86 + 3 * 2 + 9 * 1 = 101. - _David A. Corneth_, Mar 21 2015
		

Crossrefs

Programs

  • Mathematica
    t = Nest[Join[#, # + 1] &, {0}, 14]; Table[Sum[3^t[[i + 1]], {i, 1, n}]/3, {n, 60}] (* Michael De Vlieger, Mar 21 2015 *)
  • PARI
    a(n) = sum(i=1, n+1, 3^hammingweight(i))/3; \\ Michel Marcus, Mar 07 2015
    
  • PARI
    a(n)={b=binary(n+1);t=#b;e=-1;sum(i=1,#b,e+=(b[i]==1);(b[i]==1)*3^e*((4^(#b-i)-1)/3+1))} \\ David A. Corneth, Mar 21 2015

Formula

a(n) = (A147562(n+2) - 1)/4 = (A151917(n+2) - 1)/2. - Omar E. Pol, Mar 13 2011
a(n) = (A130665(n+1) - 1)/3. - Omar E. Pol, Mar 07 2015
a(n) = a(n-1) + 3^A000120(n+1)/3. - David A. Corneth, Mar 21 2015