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-4 of 4 results.

A307666 Number of partitions of n into consecutive positive triangular numbers.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 20 2019

Keywords

Comments

Equivalently, number of ways n can be expressed as the difference between two tetrahedral numbers. - Charlie Neder, Apr 24 2019
Records: a(10)=2, a(2180)=3, a(10053736)=4. - Robert Israel, Aug 20 2019

Examples

			10 = 1 + 3 + 6, so a(10) = 2.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    V:= Vector(N):
    for i from 1 while i*(i+1)/2 <= N do
      s:= i*(i+1)*(i+2)/6;
      for j from i-1 to 0 by -1 do
        t:= j*(j+1)*(j+2)/6;
        if s-t > N then break fi;
        V[s-t]:= V[s-t]+1
      od;
    od:
    convert(V,list); # Robert Israel, Aug 20 2019

Formula

G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(k*(k+1)/2).

A338585 Number of partitions of the n-th triangular number into exactly n positive triangular numbers.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 3, 4, 9, 16, 29, 52, 92, 173, 307, 554, 1002, 1792, 3216, 5738, 10149, 17942, 31769, 55684, 97478, 170356, 295644, 512468, 886358, 1523779, 2614547, 4476152, 7627119, 12966642, 21988285, 37142199, 62591912, 105215149, 176266155, 294591431
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 08 2020

Keywords

Examples

			The 5th triangular number is 15 and 15 = 1 + 1 + 1 + 6 + 6 = 3 + 3 + 3 + 3 + 3, so a(5) = 2.
		

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(issqr(8*n+1), n, h(n-1)))
        end:
    b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0),
          `if`(i*kn, 0, b(n, h(i-1), k)+b(n-i, h(min(n-i, i)), k-1)))
        end:
    a:= n-> (t-> b(t, h(t), n))(n*(n+1)/2):
    seq(a(n), n=0..42);  # Alois P. Heinz, Nov 10 2020
  • Mathematica
    h[n_] := h[n] = If[n < 1, 0, If[IntegerQ@Sqrt[8n+1], n, h[n-1]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, If[k == 0, 1, 0], If[i k < n || k > n, 0, b[n, h[i-1], k] + b[n-i, h[Min[n-i, i]], k-1]]];
    a[n_] := b[#, h[#], n]&[n(n+1)/2];
    a /@ Range[0, 42](* Jean-François Alcover, Nov 15 2020, after Alois P. Heinz *)
  • SageMath
    # Returns a list of length n, slow.
    def GeneralizedEulerTransform(n, a):
        R. = ZZ[[]]
        f = prod((1 - y*x^a(k) + O(x, y)^a(n)) for k in (1..n))
        coeffs = f.inverse().coefficients()
        coeff = lambda k: coeffs[x^a(k)*y^k] if x^a(k)*y^k in coeffs else 0
        return [coeff(k) for k in range(n)]
    def A338585List(n): return GeneralizedEulerTransform(n, lambda n: n*(n+1)/2)
    print(A338585List(12)) # Peter Luschny, Nov 12 2020

Formula

a(n) = [x^A000217(n) y^n] Product_{j>=1} 1 / (1 - y*x^A000217(j)).
a(n) = A319797(A000217(n),n).

A331900 Number of compositions (ordered partitions) of the n-th triangular number into distinct triangular numbers.

Original entry on oeis.org

1, 1, 1, 1, 7, 1, 3, 13, 3, 55, 201, 159, 865, 1803, 7093, 43431, 14253, 22903, 130851, 120763, 1099693, 4527293, 4976767, 7516897, 14349685, 72866239, 81946383, 167841291, 897853735, 455799253, 946267825, 5054280915, 3941268001, 17066300985, 49111862599
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 31 2020

Keywords

Examples

			a(6) = 3 because we have [21], [15, 6] and [6, 15].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; (t->
          `if`(t*(i+2)/3n, 0, b(n-t, i-1, p+1)))))((i*(i+1)/2))
        end:
    a:= n-> b(n*(n+1)/2, n, 0):
    seq(a(n), n=0..37);  # Alois P. Heinz, Jan 31 2020
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = With[{t = i(i+1)/2}, If[t(i+2)/3 < n, 0, If[n == 0, p!, b[n, i-1, p] + If[t > n, 0, b[n-t, i-1, p+1]]]]];
    a[n_] := b[n(n+1)/2, n, 0];
    a /@ Range[0, 37] (* Jean-François Alcover, Nov 17 2020, after Alois P. Heinz *)

Formula

a(n) = A331843(A000217(n)).

Extensions

More terms from Alois P. Heinz, Jan 31 2020

A360762 a(n) is the least n-gonal number that is the sum of two or more consecutive nonzero n-gonal numbers in more than one way, or -1 if no such number exists.

Original entry on oeis.org

9, 12880, 20449, 10764222, 794629045, 33205080888, 5985, 13925100
Offset: 2

Views

Author

Ilya Gutkovskiy, Feb 19 2023

Keywords

Examples

			For n = 2: 9 = 2 + 3 + 4 = 4 + 5.
For n = 3: 12880 = 91 + ... + 903 = 300 + ... + 990.
For n = 4: 20449 = 7^2 + ... + 39^2 = 38^2 + ... + 48^2.
For n = 5: 10764222 = 1617 + ... + 115787 = 31032 + ... + 126005.
From _Michael S. Branicky_, Feb 19 2023: (Start)
n-th term and indices of n-gonal numbers summing to it:
a(2) = 9: 2..4, 4..5,
a(3) = 12880: 13..42, 24..44,
a(4) = 20449: 7..39, 38..48,
a(5) = 10764222: 33..278, 144..290,
a(6) = 794629045: 1305..1505, 5321..5334,
a(7) = 33205080888: 616..3422, 3235..4192,
a(8) = 5985: 1..18, 11..19,
a(9) = 13925100: 103..235, 220..282. (End)
		

Crossrefs

Extensions

a(6)-a(9) from Michael S. Branicky, Feb 19 2023
Showing 1-4 of 4 results.