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.

A005704 Number of partitions of 3n into powers of 3.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 12, 15, 18, 23, 28, 33, 40, 47, 54, 63, 72, 81, 93, 105, 117, 132, 147, 162, 180, 198, 216, 239, 262, 285, 313, 341, 369, 402, 435, 468, 508, 548, 588, 635, 682, 729, 783, 837, 891, 954, 1017, 1080, 1152, 1224, 1296, 1377, 1458, 1539, 1632
Offset: 0

Views

Author

Keywords

Comments

Infinite convolution product of [1,2,3,3,3,3,3,3,3,3] aerated A000244 - 1 times, i.e., [1,2,3,3,3,3,3,3,3,3] * [1,0,0,2,0,0,3,0,0,3] * [1,0,0,0,0,0,0,0,0,2] * ... [Mats Granvik, Gary W. Adamson, Aug 07 2009]

References

  • R. K. Guy, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, Total[Take[Flatten[Transpose[{#1, #1, #1}]], #2]]] &, {1}, Range[2, 55]] (* Birkas Gyorgy, Apr 18 2011 *)
    a[n_] := a[n] = If[n <= 2, n + 1, a[n - 1] + a[Floor[n/3]]]; Array[a, 101, 0] (* T. D. Noe, Apr 18 2011 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A005704(n): return A005704(n-1)+A005704(n//3) if n else 1 # Chai Wah Wu, Sep 21 2022

Formula

a(n) = a(n-1)+a(floor(n/3)).
Coefficient of x^(3*n) in prod(k>=0, 1/(1-x^(3^k))). Also, coefficient of x^n in prod(k>=0, 1/(1-x^(3^k)))/(1-x). - Benoit Cloitre, Nov 28 2002
a(n) mod 3 = binomial(2n, n) mod 3. - Benoit Cloitre, Jan 04 2004
Let T(x) be the g.f., then T(x)=(1-x^3)/(1-x)^2*T(x^3). [Joerg Arndt, May 12 2010]

Extensions

Formula and more terms from Henry Bottomley, Apr 30 2001