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.

A091311 Partial sums of 3^A007814(n).

Original entry on oeis.org

0, 1, 4, 5, 14, 15, 18, 19, 46, 47, 50, 51, 60, 61, 64, 65, 146, 147, 150, 151, 160, 161, 164, 165, 192, 193, 196, 197, 206, 207, 210, 211, 454, 455, 458, 459, 468, 469, 472, 473, 500, 501, 504, 505, 514, 515, 518, 519, 600, 601, 604, 605, 614, 615, 618, 619
Offset: 0

Views

Author

Ralf Stephan, Feb 24 2004

Keywords

Crossrefs

First differences are A061393(n)-1.
Cf. A005836.

Programs

  • Mathematica
    Join[{0},Accumulate[3^IntegerExponent[Range[64],2]]] (* Harvey P. Dale, May 20 2025 *)
  • PARI
    a(n)=sum(k=1,n,3^valuation(k,2))
    
  • PARI
    a(n)=if(n<1,0,if(n%2==0,3*a(n/2)+n/2,3*a((n-1)/2)+(n+1)/2))
    
  • Python
    def A091311(n): return (int(bin(n)[2:],3)<<1)-n # Chai Wah Wu, Jul 07 2022

Formula

Recurrence: a(2n) = 3a(n) + n, a(2n+1) = 3a(n) + n + 1.
G.f.: 1/(1-x) * sum(k>=0, 3^k*t/(1-t^2), t=x^2^k).
a(n) = 2*A005836(n+1) - n.