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.

Showing 1-10 of 10 results.

A117535 Number of ways of writing n as a sum of powers of 3, each power being used at most 4 times.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 2, 1, 3, 3, 2, 4, 4, 2, 3, 3, 1, 3, 3, 2, 4, 4, 2, 3, 3, 1, 4, 4, 3, 6, 6, 3, 5, 5, 2, 6, 6, 4, 8, 8, 4, 6, 6, 2, 5, 5, 3, 6, 6, 3, 4, 4, 1, 4, 4, 3, 6, 6, 3, 5, 5, 2, 6, 6, 4, 8, 8, 4, 6, 6, 2, 5, 5, 3, 6, 6, 3, 4, 4, 1, 5, 5, 4, 8, 8, 4, 7, 7, 3, 9, 9, 6, 12, 12, 6, 9, 9, 3, 8, 8, 5, 10, 10
Offset: 0

Views

Author

John W. Layman, Mar 27 2006

Keywords

Comments

It seems that this sequence can be calculated by constructing an insertion tree in which the insertion rules depend on the "age" of a term at a particular stage of the calculation. See the link for a discussion of this concept.

Examples

			a(12) = 4 because 12=9+3=9+1+1+1=3+3+3+3=3+3+3+1+1+1.
		

Crossrefs

Cf. A054390.

Programs

  • Maple
    g:= product((1+x^(3^j)+x^(2*(3^j))+x^(3*(3^j))+x^(4*(3^j))), j=0..10): gser:= series(g,x=0,106): seq(coeff(gser,x,n), n=0..103); # Emeric Deutsch, Apr 02 2006
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0,
          add(`if`(n-j*3^i<0, 0, b(n-j*3^i, i-1)), j=0..4)))
        end:
    a:= n-> b(n, ilog[3](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jun 21 2012
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 0, 0, Sum[If[n - j*3^i < 0, 0, b[n - j*3^i, i - 1]], {j, 0, 4}]]]; a[n_] := b[n, Floor[Log[3, n]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 22 2016, after Alois P. Heinz *)

Formula

G.f.: product((1+x^(3^j)+x^(2*(3^j))+x^(3*(3^j))+x^(4*(3^j))), j=0..infinity). - Emeric Deutsch, Apr 02 2006
For n>=1, a(3*n+2) = a(n); a(3*n+1) = a(n) + a(n-1); a(3*n) = a(n) + a(n-1). - Tom Edgar, Jun 21 2017
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4) * A(x^3). - Ilya Gutkovskiy, Jul 09 2019

A277872 Number of ways of writing n as a sum of powers of 4, each power being used at most four times.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 4, 3, 3, 3, 5, 2, 2, 2, 4, 2, 2, 2, 4, 2, 2, 2, 5, 3, 3, 3, 4, 1
Offset: 0

Views

Author

Timothy B. Flowers, Nov 03 2016

Keywords

Comments

Also known as the hyper 4-ary partition sequence, often denoted h_4(n).
Contains A002487 as a subsequence.

Examples

			a(72) = 4 because 72 = 64+4+4 = 64+4+1+1+1+1 = 16+16+16+16+4+4 = 16+16+16+16+4+1+1+1+1.
		

Crossrefs

Programs

  • Mathematica
    n:=250;
    r:=3;
    (* To get up to n-th term, need r such that 4^r < n < 4^(r+1)  *)
    h4 :=  CoefficientList[ Series[ Product[ (1 - q^(5*4^i))/(1 - q^(4^i)) , {i, 0, r}], {q, 0, n} ], q]

Formula

G.f.: Product_{j>=0} (1-x^(5*4^j))/(1-x^(4^j)).
G.f.: Product_{j>=0} (1+x^(4^j)+x^(2*4^j)+x^(3*4^j)+x^(4*4^j)).
a(0)=1 and for n>0, a(4n)=a(n)+a(n-1), a(4n+r)=a(n) for r=1,2,3.
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4) * A(x^4). - Ilya Gutkovskiy, Jul 09 2019

A277873 Number of ways of writing n as a sum of powers of 5, each power being used at most five times.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 2, 2, 2, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 2, 2, 2, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 2, 2, 2, 3, 1, 1, 1, 1, 2
Offset: 0

Views

Author

Timothy B. Flowers, Nov 07 2016

Keywords

Comments

Also known as the hyper 5-ary partition sequence, often denoted h_5(n).
Contains A002487 as a subsequence.

Examples

			a(140) = 4 because 140 = 125+5+5+5 = 125+5+5+1+1+1+1+1 = 25+25+25+25+25+5+5+5 = 25+25+25+25+25+5+5+1+1+1+1+1.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0,
          add(b(n-j*5^i, i-1), j=0..min(5, n/5^i))))
        end:
    a:= n-> b(n, ilog[5](n)):
    seq(a(n), n=0..120);  # Alois P. Heinz, May 01 2018
  • Mathematica
    n:=250; r:=3; (* To get up to n-th term, need r such that 5^r < n < 5^(r+1) *) h5 :=  CoefficientList[ Series[ Product[ (1 - q^(6*5^i))/(1 - q^(5^i)) , {i, 0, r}], {q, 0, n} ], q]

Formula

G.f.: Product_{j >= 0} (1-x^(6*5^j))/(1-x^(5^j)).
G.f.: Product_{j >= 0} Sum_{k=0..5} x^(k*5^j).
a(0)=1; for k>0, a(5*k) = a(k)+a(k-1) and a(5*k+r) = a(k) with r=1,2,3,4.
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4 + x^5) * A(x^5). - Ilya Gutkovskiy, Jul 09 2019

A309048 Expansion of Product_{k>=0} (1 + x^(3^k) + x^(2*3^k) - x^(3^(k+1))).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, -1, 0, 0, 1, 1, 1, 0, 1, 1, -1, 0, 0, 1, 1, 1, 0, 1, 1, -2, -1, -1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, -1, 0, 0, 1, 1, 1, 0, 1, 1, -2, -1, -1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, -1, 0, 0, 1, 1, 1, 0, 1, 1, -3, -2, -2, 1, -1, -1, 0, -1, -1, 2, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 09 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 109; CoefficientList[Series[Product[(1 + x^(3^k) + x^(2 3^k) - x^(3^(k + 1))), {k, 0, Floor[Log[3, nmax]] + 1}], {x, 0, nmax}], x]
    nmax = 109; A[] = 1; Do[A[x] = (1 + x + x^2 - x^3) A[x^3] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    a[0] = 1; a[n_] := Switch[Mod[n, 3], 0, a[n/3] - a[(n - 3)/3], 1, a[(n - 1)/3], 2, a[(n - 2)/3]]; Table[a[n], {n, 0, 109}]

Formula

G.f. A(x) satisfies: A(x) = (1 + x + x^2 - x^3) * A(x^3).
a(0) = 1; a(3*n) = a(n) - a(n-1), a(3*n+1) = a(n), a(3*n+2) = a(n).

A303824 Number of ways of writing n as a sum of powers of 6, each power being used at most six times.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2
Offset: 0

Views

Author

Seiichi Manyama, May 01 2018

Keywords

Crossrefs

Number of ways of writing n as a sum of powers of b, each power being used at most b times: A054390 (b=3), A277872 (b=4), A277873 (b=5), this sequence (b=6), A303825 (b=7).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0,
          add(b(n-j*6^i, i-1), j=0..min(6, n/6^i))))
        end:
    a:= n-> b(n, ilog[6](n)):
    seq(a(n), n=0..120);  # Alois P. Heinz, May 01 2018
  • Mathematica
    m = 100; A[_] = 1;
    Do[A[x_] = Total[x^Range[0, 6]] A[x^6] + O[x]^m // Normal, {m}];
    CoefficientList[A[x], x] (* Jean-François Alcover, Oct 19 2019 *)
  • Ruby
    def A(k, n)
      ary = [1]
      (1..n).each{|i|
        s = ary[i / k]
        s += ary[i / k - 1] if i % k == 0
        ary << s
      }
      ary
    end
    p A(6, 100)

Formula

G.f.: Product_{k>=0} (1-x^(7*6^k))/(1-x^(6^k)).
a(0)=1; for k>0, a(6*k) = a(k)+a(k-1) and a(6*k+r) = a(k) with r=1,2,3,4,5.
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4 + x^5 + x^6) * A(x^6). - Ilya Gutkovskiy, Jul 09 2019

A303825 Number of ways of writing n as a sum of powers of 7, each power being used at most seven times.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, 3
Offset: 0

Views

Author

Seiichi Manyama, May 01 2018

Keywords

Crossrefs

Number of ways of writing n as a sum of powers of b, each power being used at most b times: A054390 (b=3), A277872 (b=4), A277873 (b=5), A303824 (b=6), this sequence (b=7).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0,
          add(b(n-j*7^i, i-1), j=0..min(7, n/7^i))))
        end:
    a:= n-> b(n, ilog[7](n)):
    seq(a(n), n=0..120);  # Alois P. Heinz, May 01 2018
  • Mathematica
    m = 120; A[_] = 1;
    Do[A[x_] = Total[x^Range[0, 7]] A[x^7] + O[x]^m // Normal, {m}];
    CoefficientList[A[x], x] (* Jean-François Alcover, Oct 19 2019 *)
  • Ruby
    def A(k, n)
      ary = [1]
      (1..n).each{|i|
        s = ary[i / k]
        s += ary[i / k - 1] if i % k == 0
        ary << s
      }
      ary
    end
    p A(7, 100)

Formula

G.f.: Product_{k>=0} (1-x^(8*7^k))/(1-x^(7^k)).
a(0)=1; for k>0, a(7*k) = a(k)+a(k-1) and a(7*k+r) = a(k) with r=1,2,3,4,5,6.
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7) * A(x^7). - Ilya Gutkovskiy, Jul 09 2019

A309045 Expansion of Product_{k>=0} (1 + x^(3^k) + x^(2*3^k) + x^(3^(k+1)))^(2^k).

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 5, 3, 3, 11, 8, 8, 19, 11, 11, 25, 14, 14, 41, 27, 27, 59, 32, 32, 70, 38, 38, 110, 72, 72, 158, 86, 86, 190, 104, 104, 289, 185, 185, 395, 210, 210, 455, 245, 245, 645, 400, 400, 829, 429, 429, 915, 486, 486, 1269, 783, 783, 1623, 840, 840, 1800, 960, 960, 2472
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 09 2019

Keywords

Comments

The trisection equals the self-convolution of this sequence.

Crossrefs

Programs

  • Mathematica
    nmax = 63; CoefficientList[Series[Product[(1 + x^(3^k) + x^(2 3^k) + x^(3^(k + 1)))^(2^k), {k, 0, Floor[Log[3, nmax]] + 1}], {x, 0, nmax}], x]
    nmax = 63; A[] = 1; Do[A[x] = (1 + x + x^2 + x^3) A[x^3]^2 + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]

Formula

G.f.: Product_{k>=0} ((1 - x^(4*3^k))/(1 - x^(3^k)))^(2^k).
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3) * A(x^3)^2.

A309046 Expansion of Product_{k>=0} (1 + x^(3^k) + x^(2*3^k) + x^(3^(k+1)))^(3^k).

Original entry on oeis.org

1, 1, 1, 4, 3, 3, 9, 6, 6, 25, 19, 19, 58, 39, 39, 105, 66, 66, 211, 145, 145, 394, 249, 249, 630, 381, 381, 1114, 733, 733, 1903, 1170, 1170, 2889, 1719, 1719, 4827, 3108, 3108, 7869, 4761, 4761, 11574, 6813, 6813, 18489, 11676, 11676, 28839, 17163, 17163, 41013, 23850
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 09 2019

Keywords

Comments

The trisection equals the three-fold convolution of this sequence with themselves.

Crossrefs

Programs

  • Mathematica
    nmax = 52; CoefficientList[Series[Product[(1 + x^(3^k) + x^(2 3^k) + x^(3^(k + 1)))^(3^k), {k, 0, Floor[Log[3, nmax]] + 1}], {x, 0, nmax}], x]
    nmax = 52; A[] = 1; Do[A[x] = (1 + x + x^2 + x^3) A[x^3]^3 + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]

Formula

G.f.: Product_{k>=0} ((1 - x^(4*3^k))/(1 - x^(3^k)))^(3^k).
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3) * A(x^3)^3.

A345006 a(0) = 1; a(3*n) = a(n) + a(n-1), a(3*n+1) = a(3*n+2) = -a(n).

Original entry on oeis.org

1, -1, -1, 0, 1, 1, -2, 1, 1, -1, 0, 0, 1, -1, -1, 2, -1, -1, -1, 2, 2, -1, -1, -1, 2, -1, -1, 0, 1, 1, -1, 0, 0, 0, 0, 0, 1, -1, -1, 0, 1, 1, -2, 1, 1, 1, -2, -2, 1, 1, 1, -2, 1, 1, -2, 1, 1, 1, -2, -2, 4, -2, -2, 1, 1, 1, -2, 1, 1, -2, 1, 1, 1, -2, -2, 1, 1, 1, -2, 1, 1, -1, 0, 0, 1, -1, -1, 2, -1, -1, 0, 1, 1, -1
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 05 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := Switch[Mod[n, 3], 0, a[n/3] + a[(n - 3)/3], 1, -a[(n - 1)/3], 2, -a[(n - 2)/3]]; Table[a[n], {n, 0, 93}]
    nmax = 93; A[] = 1; Do[A[x] = (1 - x - x^2 + x^3) A[x^3] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    nmax = 93; CoefficientList[Series[Product[(1 - x^(3^k) - x^(2 3^k) + x^(3^(k + 1))), {k, 0, Floor[Log[3, nmax]] + 1}], {x, 0, nmax}], x]

Formula

G.f. A(x) satisfies: A(x) = (1 - x - x^2 + x^3) * A(x^3).
G.f.: Product_{k>=0} (1 - x^(3^k) - x^(2*3^k) + x^(3^(k+1))).

A345007 a(0) = 1; a(3*n) = a(n) - a(n-1), a(3*n+1) = a(3*n+2) = -a(n).

Original entry on oeis.org

1, -1, -1, -2, 1, 1, 0, 1, 1, -1, 2, 2, 3, -1, -1, 0, -1, -1, -1, 0, 0, 1, -1, -1, 0, -1, -1, -2, 1, 1, 3, -2, -2, 0, -2, -2, 1, -3, -3, -4, 1, 1, 0, 1, 1, 1, 0, 0, -1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, -1, -1, -2, 1, 1, 0, 1, 1, 1, 0, 0, -1, 1, 1, 0, 1, 1, -1, 2, 2, 3, -1, -1, 0, -1, -1, 2, -3, -3, -5, 2, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 05 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := Switch[Mod[n, 3], 0, a[n/3] - a[(n - 3)/3], 1, -a[(n - 1)/3], 2, -a[(n - 2)/3]]; Table[a[n], {n, 0, 95}]
    nmax = 95; A[] = 1; Do[A[x] = (1 - x - x^2 - x^3) A[x^3] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    nmax = 95; CoefficientList[Series[Product[(1 - x^(3^k) - x^(2 3^k) - x^(3^(k + 1))), {k, 0, Floor[Log[3, nmax]] + 1}], {x, 0, nmax}], x]

Formula

G.f. A(x) satisfies: A(x) = (1 - x - x^2 - x^3) * A(x^3).
G.f.: Product_{k>=0} (1 - x^(3^k) - x^(2*3^k) - x^(3^(k+1))).
Showing 1-10 of 10 results.