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

A176661 Partial sums of A061262.

Original entry on oeis.org

0, 3, 15, 36, 88, 145, 236, 357, 493, 704, 896, 1122, 1531, 1862, 2229, 2635, 3146, 3653, 4539, 5176, 5948, 6669, 7540, 8492, 9594, 10660, 11887, 13079, 14720, 16341, 17737, 19118, 20619, 22351, 24143, 26070, 28012, 30413, 33024, 35575, 37997
Offset: 0

Views

Author

Jonathan Vos Post, Apr 23 2010

Keywords

Comments

Partial sums of smallest number representable as the sum of 3 triangular numbers in exactly n ways. The subsequence of triangular numbers in the partial sum begins: 3, 15, 36. The subsequence of primes in the partial sum begins: 3, 1531, 11887, 17737, 37997, 43441.

Examples

			a(13) = 0 + 3 + 12 + 21 + 52 + 57 + 91 + 121 + 136 + 211 + 192 + 226 + 409 = 1531 is prime.
		

Crossrefs

Formula

a(n) = SUM[i=0..n] A061262(i).

A002636 Number of ways of writing n as an unordered sum of at most 3 nonzero triangular numbers.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 18 2001

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: EYPHKA! num = DELTA + DELTA + DELTA.
a(n) <= A167618(n). - Reinhard Zumkeller, Nov 07 2009
Equivalently, number of ways of writing n as an unordered sum of exactly 3 triangular numbers. - Jon E. Schoenfield, Mar 28 2021

Examples

			0 : empty sum
1 : 1
2 : 1+1
3 : 3 = 1+1+1
4 : 3+1
5 : 3+1+1
6 : 6 = 3+3
7 : 6+1 = 3+3+1
...
13 : 10 + 3 = 6 + 6 + 1, so a(13) = 2.
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102, eq. (8).
  • D. H. Lehmer, Review of Loria article, Math. Comp. 2 (1947), 301-302.
  • G. Loria, Sulla scomposizione di un intero nella somma di numeri poligonali. (Italian) Atti Accad. Naz. Lincei. Rend. Cl. Sci. Fis. Mat. Nat. (8) 1, (1946). 7-15.
  • Mel Nathanson, Additive Number Theory: The Classical Bases, Graduate Texts in Mathematics, Volume 165, Springer-Verlag, 1996. See Chapter 1.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    # reuses code in A000217
    A002636 := proc(n)
        local a,i,Ti, j,Tj, Tk ;
        a := 0 ;
        for i from 0 do
            Ti := A000217(i) ;
            if Ti > n then
                break ;
            end if;
            for j from i do
                Tj := A000217(j) ;
                if Ti+Tj > n then
                    break ;
                end if;
                Tk := n-Ti-Tj ;
                if Tk >= Tj and isA000217(Tk) then
                    a := a+1 ;
                end if;
                if Tk < Tj then
                    break ;
                end if;
            end do:
        end do:
        a ;
    end proc:
    seq(A002636(n),n=0..40) ; # R. J. Mathar, May 26 2025
  • Mathematica
    a = Table[ n(n + 1)/2, {n, 0, 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
    first(n)=my(v=vector(n+1),A,B,C); for(a=0,n, A=a*(a+1)/2; if(A>n, break); for(b=0,a, B=A+b*(b+1)/2; if(B>n, break); for(c=0,b, C=B+c*(c+1)/2; if(C>n, break); v[C+1]++))); v \\ Charles R Greathouse IV, Jun 23 2017

Extensions

More terms from Robert G. Wilson v, Sep 20 2001
Entry revised by N. J. A. Sloane, Feb 25 2007

A060773 Numbers having a unique partition into three nonnegative triangular numbers.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 11, 14, 20, 29, 50, 53
Offset: 0

Views

Author

Erich Friedman, Apr 24 2001

Keywords

Crossrefs

Cf. A111638 (n having a unique partition into three positive triangular numbers).

Programs

  • Mathematica
    trig[n_]:=n(n+1)/2; trigInv[x_]:=Ceiling[Sqrt[Max[0, 2x]]]; lim=100; nLst=Table[0, {trig[lim]}]; Do[n=trig[a]+trig[b]+trig[c]; If[n>0 && n<=trig[lim], nLst[[n]]++ ], {a, 0, lim}, {b, a, trigInv[trig[lim]-trig[a]]}, {c, b, trigInv[trig[lim]-trig[a]-trig[b]]}]; Flatten[Position[nLst, 1]] (* T. D. Noe, Aug 10 2005 *)

A115288 a(n) is the smallest number representable in exactly n ways as a sum of 2 triangular numbers and one square (each of them >= 0).

Original entry on oeis.org

0, 1, 4, 7, 10, 16, 22, 25, 64, 46, 70, 67, 92, 85, 160, 115, 106, 136, 200, 157, 190, 172, 256, 235, 568, 277, 370, 337, 400, 367, 340, 550, 556, 442, 1102, 445, 472, 631, 610, 535, 682, 697, 652, 1075, 956, 850, 1984, 865, 1172, 997, 862, 1081, 1462, 1135, 1060
Offset: 1

Views

Author

Giovanni Resta, Jan 19 2006

Keywords

Examples

			a(4)=7 since 7 can be expressed in 4 ways, 7= T(3)+T(1)+0^2 = T(3)+T(0)+1^2 = T(2)+T(0)+2^2 = T(2)+T(2)+1^2 and none of the numbers from 0 to 6 can be expressed in 4 ways.
		

Crossrefs

Programs

  • Maple
    a := [seq(0,n=0..100)] ;
    for k from 0 do
        a330861 := A330861(k) ;
        if a330861 <= nops(a) then
            if op(a330861,a) = 0 then
                a := subsop(a330861=k,a) ;
                print(a) ;
            end if;
        end if;
        if not member(0,[op(2..nops(a),a)]) then
            break;
        end if;
    end do: # R. J. Mathar, Apr 28 2020
  • Mathematica
    V=Table[0, {i, 2500}]; T[n]:=n(n+1)/2; Do[a=T[i]+T[j]+k^2;If[a<2500, V[[a+1]]++ ], {i, 0, 71}, {j, 0, i}, {k, 0, 50}]; Table[Position[V, z][[1, 1]]-1, {z, 60}]

A124978 Smallest positive number which has exactly n different partitions as a sum of 4 squares x^2+y^2+z^2+t^2.

Original entry on oeis.org

1, 4, 18, 34, 50, 66, 82, 114, 90, 130, 150, 178, 162, 198, 318, 210, 250, 234, 322, 406, 465, 330, 306, 402, 462, 390, 474, 378, 490, 486, 654, 610, 522, 450, 778, 678, 642, 570, 666, 726, 594, 714, 770, 774, 986, 630, 738, 945, 1035, 850, 1222, 978, 1014, 918
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Comments

Is it known that a(n) always exists? - Franklin T. Adams-Watters, Dec 18 2006
A002635(a(n)) = n. - Reinhard Zumkeller, Jul 13 2014

Examples

			a(4)=34 because 34 is smallest number which has 4 partitions 34=4^2+3^2+3^2+0^2 = 4^2+4^2+1^2+1^2 = 5^2+2^2+2^2+1^2 = 5^2+3^2+0^2+0^2
a(3)=18 which has 3 partitions 18=0^2+0^2+3^2+3^2=0^2+1^2+1^2+4^2=1^2+2^2+2^2+3^2.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a124978 = (+ 1) . fromJust . (`elemIndex` (tail a002635_list))
    -- Reinhard Zumkeller, Jul 13 2014
  • Mathematica
    kmin[n_] := If[n<5, 1, 10n](* empirical, should be lowered in case of doubt *);
    a[n_] := a[n] = For[k=kmin[n], True, k++, If[Length[PowersRepresentations[ k, 4, 2]] == n, Return[k]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 1000}] (* Jean-François Alcover, Mar 11 2019 *)
  • PARI
    cnt4sqr(n)={ local(cnt=0,t2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), for(z=y,floor(n-x^2-y^2), t2=n-x^2-y^2-z^2 ; if( t2>=z^2 && issquare(n-x^2-y^2-z^2), cnt++ ; ) ; ) ; ) ; ) ; return(cnt) ; }
    A124978(n)= { local(a=1) ; while(1, if( cnt4sqr(a)==n, return(a) ; ) ; a++ ; ) ; }
    { for(n=1,100, print(n," ",A124978(n)) ; ) ; } \\ R. J. Mathar, Nov 29 2006
    

Extensions

Corrected and extended by R. J. Mathar, Nov 29 2006
More terms from Franklin T. Adams-Watters, Dec 18 2006

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

A115289 a(n) is the smallest number representable in exactly n ways as a sum of one triangular number and 2 squares (each of them >= 0).

Original entry on oeis.org

0, 1, 5, 10, 19, 26, 55, 46, 53, 116, 86, 128, 173, 145, 200, 170, 221, 235, 236, 305, 341, 326, 491, 425, 548, 431, 676, 530, 536, 635, 656, 851, 905, 695, 1118, 950, 1040, 1171, 1241, 1031, 1076, 1115, 1325, 1661, 1943, 1391, 1531, 1691, 1790, 1670, 2291, 2081
Offset: 1

Views

Author

Giovanni Resta, Jan 19 2006

Keywords

Examples

			a(4)=10 since 10 can be expressed in 4 ways,
10=T(4)+0^2+0^2 = T(3)+0^2+2^2 = T(1)+0^2+3^2 = T(0)+1^2+3^2 and none of the numbers from 0 to 9 can be expressed in 4 ways.
		

Crossrefs

Programs

  • Mathematica
    V = Table[0, {i, 5000}]; T[n]:=n(n+1)/2; Do[a = T[i]+j^2+k^2; If[a<5000, V[[a+1]]++ ], {i, 0, 100}, {j, 0, 71}, {k, 0, j}]; Table[Position[V, z][[1, 1]]-1, {z, 60}]

A330810 a(n) is the largest number that can be expressed as the sum of three triangular numbers in exactly n ways.

Original entry on oeis.org

53, 194, 470, 788, 1730, 2000, 2693, 4310, 6053, 6845, 10688, 11348, 13970, 12923, 20768, 17135, 27830, 26480, 36245, 31688, 37073, 39983, 57860, 46940, 49148, 68258, 62810, 66515, 76985, 73868, 82850, 123878, 87890, 119810, 111053, 118490, 118880, 119183
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 01 2020

Keywords

Comments

One or more of the three triangular numbers may be zeros. If it were required that the triangular numbers be positive, sequence A330811 would result.

Crossrefs

A330811 a(n) is the largest number that can be expressed as the sum of three positive triangular numbers in exactly n ways.

Original entry on oeis.org

29, 119, 335, 713, 1730, 1328, 3413, 3485, 4565, 6053, 6950, 10688, 11348, 13970, 16778, 20768, 18173, 36245, 26480, 27203, 37073, 35033, 39983, 57860, 46940, 49148, 68258, 62810, 66515, 76985, 73868, 123878, 103403, 87890, 119810, 111053, 118490, 118880
Offset: 0

Views

Author

Jon E. Schoenfield, Jan 01 2020

Keywords

Comments

If the triangular numbers were not required to be positive, sequence A330810 would result.

Crossrefs

Showing 1-9 of 9 results.