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 17 results. Next

A008443 Number of ordered ways of writing n as the sum of 3 triangular numbers.

Original entry on oeis.org

1, 3, 3, 4, 6, 3, 6, 9, 3, 7, 9, 6, 9, 9, 6, 6, 15, 9, 7, 12, 3, 15, 15, 6, 12, 12, 9, 12, 15, 6, 13, 21, 12, 6, 15, 9, 12, 24, 9, 18, 12, 9, 18, 15, 12, 13, 24, 9, 15, 24, 6, 18, 27, 6, 12, 15, 18, 24, 21, 15, 12, 27, 9, 13, 18, 15, 27, 27, 9, 12, 27, 15, 24, 21, 12, 15, 30, 15, 12
Offset: 0

Views

Author

Keywords

Comments

Fermat asserted that every number is the sum of three triangular numbers. This was proved by Gauss, who recorded in his Tagebuch entry for Jul 10 1796 that: EYPHEKA! num = DELTA + DELTA + DELTA. See also Gauss, DA, art. 293.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Andrews (2016), Theorem 2, shows that A008443(n) = A290735(n) + A290737(n) + A290739(n). = N. J. A. Sloane, Aug 10 2017

Examples

			5 can be written as 3+1+1, 1+3+1, 1+1+3, so a(5) = 3.
G.f. = 1 + 3*x + 3*x^2 + 4*x^3 + 6*x^4 + 3*x^5 + 6*x^6 + 9*x^7 + 3*x^8 + ...
G.f. = q^3 + 3*q^11 + 3*q^19 + 4*q^27 + 6*q^35 + 3*q^43 + 6*q^51 + 9*q^59 + 3*q^67 + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
  • C. F. Gauss, Disquisitiones Arithmeticae, Yale University Press, 1966, New Haven and London, p. 342, art. 293.
  • M. Nathanson, Additive Number Theory: The Classical Bases, Graduate Texts in Mathematics, Volume 165, Springer-Verlag, 1996. See Chapter 1.

Crossrefs

Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440,A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Partial sums are in A038835.

Programs

  • Magma
    Basis( ModularForms( Gamma0(16), 3/2), 630)[4]; /* Michael Somos, Aug 26 2015 */
  • Maple
    s1 := sum(q^(n*(n+1)/2), n=0..30): s2 := series(s1^3, q, 250): for i from 0 to 200 do printf(`%d,`,coeff(s2, q, i)) od:
  • Mathematica
    s1 = Sum[q^(n (n + 1)/2), {n, 0, 12}]; s2 = Series[s1^3, {q, 0, 80}]; CoefficientList[s2, q] (* Jean-François Alcover, Oct 04 2011, after Maple *)
    a[ n_] := SeriesCoefficient[ (1/8) EllipticTheta[ 2, 0, q]^3, {q, 0, 2 n + 3/4}]; (* Michael Somos, May 29 2012 *)
    QP = QPochhammer; CoefficientList[(QP[q^2]^2/QP[q])^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(8*n + 1) - 1)\2, x^((k^2 + k)/2), x * O(x^n))^3, n))}; /* Michael Somos, Oct 25 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^2 / eta(x + A))^3, n))}; /* Michael Somos, Oct 25 2006 */
    

Formula

Expansion of Jacobi theta constant theta_2^3 /8. G.f. is cube of g.f. for A010054.
Expansion of psi(q)^3 in powers of q where psi() is a Ramanujan theta function (A010054). - Michael Somos, Oct 25 2006
Expansion of q^(-3/8) * (eta(q^2)^2 / eta(q))^3 in powers of q. - Michael Somos, May 29 2012
Euler transform of period 2 sequence [ 3, -3, ...]. - Michael Somos, Oct 25 2006
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-3/2) (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A213384. - Michael Somos, Jun 23 2012
a(3*n) = A213627(n). a(3*n + 1) = 3 * A213617(n). a(3*n + 2) = A181648(n). - Michael Somos, Jun 23 2012
G.f.: (Sum_{k>0} x^((k^2 - k)/2))^3 = (Product_{k>0} (1 + x^k) * (1 - x^(2*k)))^3. - Michael Somos, May 29 2012
a(n) = A005869(n)/2 = A005886(n)/4 = A005878(n)/8.
a(n) = A005875(8*n+3)/8. See, e.g., the Ono et al. link: The case k=3. - Wolfdieter Lang, Jan 12 2017
a(0) = 1, a(n) = (3/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, May 06 2017

Extensions

More terms from James Sellers, Feb 07 2001

A053604 Number of ways to write n as an ordered sum of 3 nonzero triangular numbers.

Original entry on oeis.org

0, 0, 0, 1, 0, 3, 0, 3, 3, 1, 6, 0, 6, 3, 6, 3, 3, 9, 1, 12, 0, 6, 9, 6, 6, 6, 9, 6, 12, 0, 10, 9, 12, 6, 9, 9, 3, 18, 3, 12, 12, 9, 9, 9, 12, 10, 12, 9, 9, 18, 6, 6, 27, 6, 12, 6, 9, 18, 15, 15, 6, 21, 9, 13, 12, 9, 18, 21, 9, 6, 21, 15, 15, 15, 12, 15, 18, 15, 9
Offset: 0

Views

Author

N. J. A. Sloane, Jan 20 2000

Keywords

Comments

Fermat asserted that every number is the sum of three triangular numbers. This was proved by Gauss, who recorded in his Tagebuch entry for Jul 10 1796 that: EYPHEKA! num = DELTA + DELTA + DELTA.

References

  • Mel Nathanson, Additive Number Theory: The Classical Bases, Graduate Texts in Mathematics, Volume 165, Springer-Verlag, 1996. See Chapter 1.

Crossrefs

Programs

  • Mathematica
    nmax = 100; m0 = 10; A053604 :=
    Table[a[n], {n, 0, nmax}]; Clear[counts];
    counts[m_] :=
    counts[m] = (Clear[a]; a[_] = 0;
       Do[s = i*(i + 1)/2 + j*(j + 1)/2 + k*(k + 1)/2;
        a[s] = a[s] + 1, {i, 1, m}, {j, 1, m}, {k, 1, m}];
       A053603); counts[m = m0]; counts[m = 2*m]; While[
    counts[m] != counts[m/2], m = 2*m]; A053604  (* G. C. Greubel, Dec 24 2016 *)

Formula

G.f.: ( Sum_{k>=1} x^(k*(k+1)/2) )^3. - Ilya Gutkovskiy, Dec 24 2016

A063993 Number of ways of writing n as an unordered sum of exactly 3 nonzero triangular numbers.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 18 2001

Keywords

Comments

a(A002097(n)) = 0; a(A111638(n)) = 1; a(A064825(n)) = 2. - Reinhard Zumkeller, Jul 20 2012

Examples

			5 = 3 + 1 + 1, so a(5) = 1.
		

Crossrefs

Cf. A053604, A008443, A002636, A064181 (greedy inverse), A307598 (3 distinct positive).
Column k=3 of A319797.

Programs

  • Haskell
    a063993 n = length [() | let ts = takeWhile (< n) $ tail a000217_list,
                        x <- ts, y <- takeWhile (<= x) ts,
                        let z = n - x - y, 0 < z, z <= y, a010054 z == 1]
    -- Reinhard Zumkeller, Jul 20 2012
    
  • Maple
    A063993 := proc(n)
        local a,t1idx,t2idx,t1,t2,t3;
        a := 0 ;
        for t1idx from 1 do
            t1 := A000217(t1idx) ;
            if 3*t1 > n then
                break;
            end if;
            for t2idx from t1idx do
                t2 := A000217(t2idx) ;
                if t1+t2 > n then
                    break;
                end if;
                t3 :=  n-t1-t2 ;
                if t3 >= t2 then
                    if isA000217(t3) then
                        a := a+1 ;
                    end if;
                end if ;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Apr 28 2020
  • Mathematica
    a = Table[ n(n + 1)/2, {n, 1, 15} ]; b = {0}; c = Table[ 0, {100} ]; Do[ b = Append[ b, a[ [ i ] ] + a[ [ j ] ] + a[ [ k ] ] ], {k, 1, 15}, {j, 1, k}, {i, 1, j} ]; b = Delete[ b, 1 ]; b = Sort[ b ]; l = Length[ b ]; Do[ If[ b[ [ n ] ] < 100, c[ [ b[ [ n ] ] + 1 ] ]++ ], {n, 1, l} ]; c
  • PARI
    trmx(n)=my(k=sqrtint(8*n+1)\2);if(k^2+k>2*n,k-1,k)
    trmn(n)=trmx(ceil(n)-1)+1
    a(n)=if(n<3, return(0)); sum(a=trmn(n/3),trmx(n-2),my(t=n-a*(a+1)/2);sum(b=trmn(t/2),min(trmx(t-1),a), ispolygonal(t-b*(b+1)/2,3))) \\ Charles R Greathouse IV, Jul 07 2022

Extensions

More terms from Robert G. Wilson v, Sep 20 2001

A061262 Smallest number representable as the sum of 3 triangular numbers in exactly n ways.

Original entry on oeis.org

0, 3, 12, 21, 52, 57, 91, 121, 136, 211, 192, 226, 409, 331, 367, 406, 511, 507, 886, 637, 772, 721, 871, 952, 1102, 1066, 1227, 1192, 1641, 1621, 1396, 1381, 1501, 1732, 1792, 1927, 1942, 2401, 2611, 2551, 2422, 2557, 2887, 2821, 3136, 3271, 3607, 3376
Offset: 1

Views

Author

Ed Pegg Jr, Apr 24 2001

Keywords

Comments

Fermat claimed, Euler tried, Gauss proved (July 10, 1796) that every number can be represented as a sum of three triangular numbers. I'm considering 0 as a triangular number here. If at first you do not succeed, tri + tri + tri again.
Conjecture: for n large enough, 1 < a(n)/n^2 < 2. - Benoit Cloitre, May 10 2003
Conjecture: No term a(n) with n > 2 is congruent to 0 or 3 modulo 5. - Zhi-Wei Sun, Feb 25 2015

Examples

			57 is the smallest number that can be represented by exactly 6 different triangular triple sums: {6, 6, 5}, {7, 7, 1}, {8, 5, 3}, {8, 6, 0}, {9, 3, 3}, {10, 1, 1}.
		

Crossrefs

Programs

  • Mathematica
    a = Table[ n(n + 1)/2, {n, 0, 85} ]; b = {0}; c = Table[0, {3655} ]; Do[ b = Append[b, a[[i] ] + a[[j]] + a[[k]]], {k, 1, 85}, {j, 1, k}, {i, 1, j} ]; b = Delete[b, 1]; b = Sort[b]; l = Length[b]; Do[ If[b[[n]] < 3655, c[[b[[n]] + 1]]++ ], {n, 1, l} ]; Do[ k = 1; While[ c[[k]] != n, k++ ]; Print[k - 1], {n, 1, 48} ]

A117048 Prime numbers that are expressible as the sum of two positive triangular numbers.

Original entry on oeis.org

2, 7, 11, 13, 29, 31, 37, 43, 61, 67, 73, 79, 83, 97, 101, 127, 137, 139, 151, 157, 163, 181, 191, 193, 199, 211, 227, 241, 263, 277, 281, 307, 331, 353, 367, 373, 379, 389, 409, 421, 433, 443, 461, 463, 487, 499, 541, 571, 577, 587, 601, 619, 631, 659, 661
Offset: 1

Views

Author

Andrew S. Plewe, Apr 15 2006

Keywords

Comments

If the triangular number 0 is allowed, only one additional prime occurs: 3. In that case, the sequence becomes A117112.
A subsequence of A051533. - Wolfdieter Lang, Jan 11 2017

Examples

			2 = 1 + 1
7 = 1 + 6
11 = 1 + 10
13 = 10 + 3, etc.
		

Crossrefs

Programs

  • Mathematica
    tri = Table[n (n + 1)/2, {n, 40}]; Select[Union[Flatten[Outer[Plus, tri, tri]]], # <= tri[[-1]]+1 && PrimeQ[#] &] (* T. D. Noe, Apr 07 2011 *)
  • PARI
    is(n)=for(k=sqrtint(4*n+1)\2+1,(sqrtint(8*n+1)-1)\2, if(ispolygonal(n-k*(k+1)/2,3), return(n>3 && isprime(n)))); n==2 \\ Charles R Greathouse IV, Nov 07 2014

A085263 Number of ways to write n as the sum of a squarefree number (A005117) and a positive square (A000290).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 23 2003

Keywords

Comments

a(A085265(n))>0; a(A085266(n))=1; a(A085267(n))>1.
a(A085264(n))=n and a(i)<>n for i < A085264(n).
First occurrence of k: 2, 6, 11, 23, 30, 38, 62, 71, 83, 110, 138, 155, 182, 203, 227, 263, 302, 327, 383, 435, 447, 503, 542, 602, 635, ..., . Conjecture: For each k above, there is a finite number of terms; for example, only the two numbers 1 and 13 cannot be represented as the sum of a squarefree number and a square. The number of k terms beginning with 0: 2, 9, 19, 27, 38, 36, 57, 63, 62, 74, 94, ..., . - Robert G. Wilson v, May 16 2014

Examples

			a(11)=3:
11 = 1 + 10 = A000290(1) + A005117(7)
   = 4 + 7  = A000290(2) + A005117(6)
   = 9 + 2  = A000290(3) + A005117(2).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Count[ SquareFreeQ@# & /@ (n - Range[1, Floor[ Sqrt[ n]]]^2), True]; Array[f, 105] (* Robert G. Wilson v, May 16 2014 *)
  • PARI
    a(n) = sum(k=1, n-1, issquare(k) * issquarefree(n-k)); \\ Michel Marcus, Oct 30 2020

Formula

a(n+1) = Sum_{k=1..n} A008966(k)*A010052(n-k+1). - Reinhard Zumkeller, Nov 04 2009
a(n) < sqrt(n). - Robert G. Wilson v, May 17 2014
G.f.: (Sum_{i>=1} x^(i^2))*(Sum_{j>=1} mu(j)^2*x^j). - Ilya Gutkovskiy, Feb 06 2017

A063992 Numbers that are not factorials.

Original entry on oeis.org

3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78
Offset: 1

Views

Author

N. J. A. Sloane, Oct 11 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A002636.
A012245(a(n)) = 0. - Reinhard Zumkeller, Oct 11 2008

Crossrefs

Complement of A000142.

Programs

  • Mathematica
    With[{nn=5},Complement[Range[nn!],Range[nn]!]] (* Harvey P. Dale, May 05 2019 *)
  • PARI
    { n=0; f=2; for (m=3, 10^9, g=f; f*=m; for (a=g + 1, f - 1, write("b063992.txt", n++, " ", a); if (n==1000, break)); if (n==1000, break) ) } \\ Harry J. Smith, Sep 05 2009

A071530 Numbers that are the sum of 3 triangular numbers in exactly 2 ways.

Original entry on oeis.org

3, 6, 7, 9, 10, 13, 15, 17, 18, 19, 23, 24, 25, 26, 32, 33, 35, 38, 41, 44, 47, 54, 60, 62, 68, 69, 74, 80, 83, 89, 95, 99, 110, 113, 119, 128, 179, 194
Offset: 1

Views

Author

Benoit Cloitre, Jun 02 2002

Keywords

Comments

If it is required that the triangular numbers be positive, sequence A064825 results. - Jon E. Schoenfield, Jan 01 2020

Examples

			From _Jon E. Schoenfield_, Jan 01 2020: (Start)
15 is a term of the sequence because there are exactly 2 ways to express 15 as the sum of 3 triangular numbers: 15 = 6 + 6 + 3 = 15 + 0 + 0.
60 is a term because there are exactly 2 ways to express 60 as the sum of 3 triangular numbers: 60 = 36 + 21 + 3 = 45 + 15 + 0.
12 can be expressed as the sum of 3 triangular numbers in 3 ways, so it is not a term: 12 = 10 + 1 + 1 = 6 + 6 + 0 = 6 + 3 + 3. (End)
		

Crossrefs

Programs

  • Mathematica
    With[{max = 20}, t = Accumulate[Range[0, max]]; Select[Range[t[[-1]]], Length[IntegerPartitions[#, {3}, t]] == 2 &]] (* Amiram Eldar, May 14 2025 *)
  • PARI
    for(n=1,150,if(sum(i=0,n,sum(j=0,i,sum(k=0,j,if(i*(i+1)/2+j*(j+1)/2+k*(k+1)/2-n,0,1))))==2,print1(n,",")))

Formula

{n: A002636(n) =2}. - R. J. Mathar, May 26 2025

Extensions

More terms from Vladeta Jovovic, Jun 07 2002
Removed keyword "more" because this is probably finite. - R. J. Mathar, May 26 2025

A224326 Number of partitions of n into 3 distinct triangular numbers.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Apr 03 2013

Keywords

Comments

Indices of zeros: 0 followed by A002243.

Crossrefs

Cf. A025436 (number of partitions of n into 3 distinct squares).
Cf. A002636 (allows nondistinct triangular numbers).

Programs

  • Mathematica
    nn = 150; tri = Table[n*(n + 1)/2, {n, 0, nn}]; t = Table[0, {tri[[-1]]}]; Do[s = tri[[i]] + tri[[j]] + tri[[k]]; If[s <= tri[[-1]], t[[s]]++], {i, nn}, {j, i + 1, nn}, {k, j + 1, nn}]; t = Join[{0}, t] (* T. D. Noe, Apr 05 2013 *)
  • Python
    TOP = 777
    for n in range(TOP):
      k = 0
      for x in range(TOP):
        s = x*(x+1)//2
        if s>n: break
        for y in range(x+1,TOP):
            sy = s + y*(y+1)//2
            if sy>n: break
            for z in range(y+1,TOP):
              sz = sy + z*(z+1)//2
              if sz>n: break
              if sz==n: k+=1
      print(str(k), end=',')

A242442 Number of ways of writing n, a positive integer, as an unordered sum of a triangular number (A000217), an odd square (A016754) and a pentagonal number (A000326).

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 14 2014

Keywords

Comments

It is conjectured that only 18 cannot be so represented. See Sun, p. 4, Remark 1.2 (b).

Crossrefs

Programs

  • Mathematica
    planeFigurative[n_, r_] := (n - 2) Binomial[r, 2] + r; s = Sort@ Flatten@ Table[ planeFigurative[3, i] + planeFigurative[4, j] + planeFigurative[5, k], {i, 0, 20}, {j, 1, 11, 2}, {k, 0, 8}]; Table[ Count[s, n], {n, 0, 104}]
Showing 1-10 of 17 results. Next