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

A051533 Numbers that are the sum of two positive triangular numbers.

Original entry on oeis.org

2, 4, 6, 7, 9, 11, 12, 13, 16, 18, 20, 21, 22, 24, 25, 27, 29, 30, 31, 34, 36, 37, 38, 39, 42, 43, 46, 48, 49, 51, 55, 56, 57, 58, 60, 61, 64, 65, 66, 67, 69, 70, 72, 73, 76, 79, 81, 83, 84, 87, 88, 90, 91, 92, 93, 94, 97, 99, 100, 101, 102, 106, 108
Offset: 1

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de)

Keywords

Comments

Numbers n such that 8n+2 is in A085989. - Robert Israel, Mar 06 2017

Examples

			666 is in the sequence because we can write 666 = 435 + 231 = binomial(22,2) + binomial(30,2).
		

Crossrefs

Cf. A000217, A020756 (sums of two triangular numbers), A001481 (sums of two squares), A007294, A051611 (complement).
Cf. A061336: minimal number of triangular numbers that sum up to n.
Cf. A085989.

Programs

  • Haskell
    a051533 n = a051533_list !! (n-1)
    a051533_list = filter ((> 0) . a053603) [1..]
    -- Reinhard Zumkeller, Jun 28 2013
    
  • Maple
    isA051533 := proc(n)
        local a,ta;
        for a from 1 do
            ta := A000217(a) ;
            if 2*ta > n then
                return false;
            end if;
            if isA000217(n-ta) then
                return true;
            end if;
        end do:
    end proc:
    for n from 1 to 200 do
        if isA051533(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 16 2015
  • Mathematica
    f[k_] := If[!
       Head[Reduce[m (m + 1) + n (n + 1) == 2 k && 0 < m && 0 < n, {m, n},
           Integers]] === Symbol, k, 0]; DeleteCases[Table[f[k], {k, 1, 108}], 0] (* Ant King, Nov 22 2010 *)
    nn=50; tri=Table[n(n+1)/2, {n,nn}]; Select[Union[Flatten[Table[tri[[i]]+tri[[j]], {i,nn}, {j,i,nn}]]], #<=tri[[-1]] &]
    With[{nn=70},Take[Union[Total/@Tuples[Accumulate[Range[nn]],2]],nn]] (* Harvey P. Dale, Jul 16 2015 *)
  • PARI
    is(n)=for(k=ceil((sqrt(4*n+1)-1)/2),(sqrt(8*n-7)-1)\2, if(ispolygonal(n-k*(k+1)/2, 3), return(1))); 0 \\ Charles R Greathouse IV, Jun 09 2015

Formula

A053603(a(n)) > 0. - Reinhard Zumkeller, Jun 28 2013
A061336(a(n)) = 2. - M. F. Hasler, Mar 06 2017

A052343 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed).

Original entry on oeis.org

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

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Comments

Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed). - Michael Somos, Aug 18 2003
a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - Reinhard Zumkeller, May 15 2006
Also, number of ways to write 4n+1 as the unordered sum of two squares of nonnegative integers. - Vladimir Shevelev, Jan 21 2009
The average value of a(n) for n <= x is Pi/4 + O(1/sqrt(x)). - Vladimir Shevelev, Feb 06 2009

Examples

			G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^6 + x^7 + x^9 + x^10 + x^11 + ...
		

Crossrefs

Programs

  • Haskell
    a052343 = (flip div 2) . (+ 1) . a008441
    -- Reinhard Zumkeller, Jul 25 2014
  • Maple
    A052343 := proc(n)
        local a,t1idx,t2idx,t1,t2;
        a := 0 ;
        for t1idx from 0 do
            t1 := A000217(t1idx) ;
            if t1 > n then
                break;
            end if;
            for t2idx from t1idx do
                t2 := A000217(t2idx) ;
                if t1+t2 > n then
                    break;
                elif t1+t2 = n then
                    a := a+1 ;
                end if;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Apr 28 2020
  • Mathematica
    Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* Ant King, Dec 01 2010 *)
    d1[k_]:=Length[Select[Divisors[k],Mod[#,4]==1&]];d3[k_]:=Length[Select[Divisors[k],Mod[#,4]==3&]];f[k_]:=d1[k]-d3[k];g[k_]:=If[IntegerQ[Sqrt[4k+1]],1/2 (f[4k+1]+1),1/2 f[4k+1]];g[#]&/@Range[0,101] (* Ant King, Dec 01 2010 *)
    a[ n_] := Length @ Select[ Table[ Sqrt[n - i - i^2], {i, 0, Quotient[ Sqrt[4 n + 1] - 1, 2]}], IntegerQ]; (* Michael Somos, Jul 28 2015 *)
    a[ n_] := Length @ FindInstance[ {j >= 0, k >= 0, j^2 + k^2 + k == n}, {k, j}, Integers, 10^9]; (* Michael Somos, Jul 28 2015 *)
  • PARI
    {a(n) = if( n<0, 0, sum(i=0, (sqrtint(4*n + 1) - 1)\2, issquare(n - i - i^2)))}; /* Michael Somos, Aug 18 2003 */
    

Formula

a(n) = ceiling(A008441(n)/2). - Reinhard Zumkeller, Nov 03 2009
G.f.: (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k>=0} x^(k^2)). - Michael Somos, Aug 18 2003
Recurrence: a(n) = Sum_{k=1..r(n)} r(2n-k^2+k) - C(r(n),2) - a(n-1) - a(n-2) - ... - a(0), n>=1,a (0)=1, where r(n)=A000194(n+1) is the nearest integer to square root of n+1. For example, since r(6)=3, a(6) = r(12) + r(10) + r(6) - C(3,2) - a(5) - ... - a(0) = 4 + 3 + 3 - 3 - 0 - 1 - 1 - 1 - 1 - 1 = 2. - Vladimir Shevelev, Feb 06 2009
a(n) = A025426(8n+2). - Max Alekseyev, Mar 09 2009
a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - Ant King, Dec 01 2010
a(2*n + 1) = A053692(n). a(4*n + 1) = A259287(n). a(4*n + 3) = A259285(n). a(6*n + 1) = A260415(n). a(6*n + 4) = A260516(n). - Michael Somos, Jul 28 2015
a(3*n) = A093518(n). a(3*n + 1) = A121444(n). a(9*n + 2) = a(n). a(9*n + 5) = a(9*n + 8) = 0. - Michael Somos, Jul 28 2015
Convolution of A005369 and A010052. - Michael Somos, Jul 28 2015

A020757 Numbers that are not the sum of two triangular numbers.

Original entry on oeis.org

5, 8, 14, 17, 19, 23, 26, 32, 33, 35, 40, 41, 44, 47, 50, 52, 53, 54, 59, 62, 63, 68, 71, 74, 75, 77, 80, 82, 85, 86, 89, 95, 96, 98, 103, 104, 107, 109, 113, 116, 117, 118, 122, 124, 125, 128, 129, 131, 134, 138, 140, 143, 145, 147, 149, 152, 155, 158, 161, 162, 166, 167
Offset: 1

Views

Author

Keywords

Comments

A052343(a(n)) = 0. - Reinhard Zumkeller, May 15 2006
Numbers of the form (p^(2k+1)s-1)/4, where p is a prime number of the form 4n+3, and s is a number of the form 4m+3 and prime to p, are not expressible as the sum of two triangular numbers. See Satyanarayana (1961), Theorem 2. - Hans J. H. Tuenter, Oct 11 2009
An integer n is in this sequence if and only if at least one 4k+3 prime factor in the canonical form of 4n+1 occurs with an odd exponent. - Ant King, Dec 02 2010
A nonnegative integer n is in this sequence if and only if A000729(n) = 0. - Michael Somos, Feb 13 2011
4*a(n) + 1 are terms of A022544. - XU Pingya, Aug 05 2018 [Actually, k is here if and only if 4*k + 1 is in A022544. - Jianing Song, Feb 09 2021]
Integers m such that the smallest number of triangular numbers which sum to m is 3, hence A061336(a(n)) = 3. - Bernard Schott, Jul 21 2022

Examples

			3 = 0 + 3 and 7 = 1 + 6 are not terms, but 8 = 1 + 1 + 6 is a term.
		

Crossrefs

Complement of A020756.
Numbers k such that the coefficient of x^k in the expansion of Product_{j>=1} (1 - x^j)^m is zero: A090864 (m=1), A213250 (m=2), A014132 (m=3), A302056 (m=4), A302057 (m=5), this sequence (m=6), A322430 (m=8), A322431 (m=10), A322432 (m=14), A322043 (m=15), A322433 (m=26).

Programs

  • Haskell
    a020757 n = a020757_list !! (n-1)
    a020757_list = filter ((== 0) . a052343) [0..]
    -- Reinhard Zumkeller, Jul 25 2014
    
  • Mathematica
    data = Reduce[m (m + 1) + n (n + 1) == 2 # && 0 <= m && 0 <= n, {m, n}, Integers] & /@ Range[167]; Position[data, False] // Flatten  (* Ant King, Dec 05 2010 *)
    t = Array[PolygonalNumber, 18, 0]; Complement[Range@ 169, Flatten[ Outer[ Plus, t, t]]] (* Robert G. Wilson v, Aug 07 2024 *)
  • PARI
    is(n)=my(m9=n%9,f); if(m9==5 || m9==8, return(1)); f=factor(4*n+1); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(1))); 0 \\ Charles R Greathouse IV, Mar 17 2022

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

A117112 Primes expressible as the sum of two triangular numbers (including zero).

Original entry on oeis.org

2, 3, 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

Greg Huber, Apr 18 2006

Keywords

Comments

See A117048 for the primes that are the sum of two positive triangular numbers. The only difference is that the prime 3 occurs here.

Examples

			2 = 1 + 1
3 = 0 + 3
7 = 1 + 6
and so on.
		

Crossrefs

Programs

  • Mathematica
    tri = Table[n (n + 1)/2, {n, 0, 40}]; Select[Union[Flatten[Outer[Plus, tri, tri]]], # <= tri[[-1]]+1 && PrimeQ[#] &] (* T. D. Noe, Apr 07 2011 *)
    Select[Total/@Tuples[Accumulate[Range[0,40]],2],PrimeQ]//Union (* Harvey P. Dale, Apr 21 2019 *)

Formula

A000040 intersect A020756. - Jonathan Vos Post, Apr 17 2006

A119345 Numbers having exactly one representation as sum of two triangular numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 9, 10, 11, 12, 13, 15, 18, 20, 22, 24, 25, 27, 28, 29, 30, 34, 37, 38, 39, 43, 45, 48, 49, 57, 58, 60, 61, 64, 65, 67, 69, 70, 73, 78, 79, 83, 84, 87, 88, 90, 92, 93, 97, 99, 100, 101, 102, 105, 108, 110, 112, 114, 115, 119, 127, 130, 132, 135, 137, 139, 142
Offset: 1

Views

Author

Reinhard Zumkeller, May 15 2006

Keywords

Comments

A052343(a(n)) = 1; gives A020756 together with A118139.

Crossrefs

Programs

  • Haskell
    a119345 n = a119345_list !! (n-1)
    a119345_list = filter ((== 1) . a052343) [0..]
    -- Reinhard Zumkeller, Jul 25 2014
  • Mathematica
    trn=SortBy[{First[#],Last[#],Total[#]}& /@ (Union[Sort/@Tuples[Accumulate[Range[0,70]],{2}]]),Last]; Take[With[{x=Transpose[trn][[3]]}, Complement[Union[x], Union[Flatten[Select[Split[x], Length[#]>1&]]]]],70]  (* Harvey P. Dale, Feb 14 2011 *)
    nn=100; tri=Table[n(n+1)/2,{n,0,nn}]; sums=Select[Flatten[Table[tri[[i]]+tri[[j]], {i,nn}, {j,i}]], #
    				

A118139 Numbers expressible as the sum of two triangular numbers in at least two different ways.

Original entry on oeis.org

6, 16, 21, 31, 36, 42, 46, 51, 55, 56, 66, 72, 76, 81, 91, 94, 106, 111, 120, 121, 123, 126, 133, 136, 141, 146, 156, 157, 171, 172, 174, 181, 186, 191, 196, 198, 210, 211, 216, 225, 226, 231, 237, 241, 246, 256, 259, 268, 276, 281, 286, 289, 291, 297, 301, 306
Offset: 1

Views

Author

Greg Huber, May 13 2006

Keywords

Comments

A052343(a(n)) > 1; gives A020756 together with A119345. - Reinhard Zumkeller, May 15 2006

Examples

			a(1) = 6 = 0 + 6 = 3 +3.
a(2) = 16 = 1 + 15 = 6 + 10.
a(3) = 21 = 0 + 21 = 6 + 15.
		

Crossrefs

Programs

  • Haskell
    a118139 n = a118139_list !! (n-1)
    a118139_list = filter ((> 1) . a052343) [0..]
    -- Reinhard Zumkeller, Jul 25 2014
  • Mathematica
    Sort[Transpose[Select[Tally[Total/@(Union[Sort/@Tuples[Accumulate[ Range[ 0,30]],2]])],#[[2]]>1&]][[1]]] (* Harvey P. Dale, Jul 21 2015 *)

Extensions

More terms from Reinhard Zumkeller, May 15 2006

A185978 Nontriangular numbers which are the sum of two (positive) triangular numbers.

Original entry on oeis.org

2, 4, 7, 9, 11, 12, 13, 16, 18, 20, 22, 24, 25, 27, 29, 30, 31, 34, 37, 38, 39, 42, 43, 46, 48, 49, 51, 56, 57, 58, 60, 61, 64, 65, 67, 69, 70, 72, 73, 76, 79, 81, 83, 84, 87, 88, 90, 92, 93, 94, 97, 99, 100, 101, 102, 106, 108
Offset: 1

Views

Author

Wolfdieter Lang, Feb 14 2011

Keywords

Comments

This is A051533 (sums of two positive triangular numbers) excluding triangular numbers.
This is also A020756 (sums of two triangular numbers) excluding triangular numbers.
There may be multiple representations, e.g., 16 = 1 + 15 = 6 + 10.

Examples

			a(6) = 12 = 6 + 6,
a(17) = 31 = 3 + 28 = 10 + 21.
		

Crossrefs

Cf. A000217, A020756 (sums of two triangular numbers), A051533 (sums of two positive triangular numbers).

Programs

Formula

This is the sorted, made unique set {binomial(k+1,2) + binomial(L+1,2), 1 <= k <= L sufficiently large}, excluding members from A000217 (triangular numbers).

A288631 Numbers that are the sum of two nonzero square pyramidal numbers (A000330).

Original entry on oeis.org

2, 6, 10, 15, 19, 28, 31, 35, 44, 56, 60, 69, 85, 92, 96, 105, 110, 121, 141, 145, 146, 154, 170, 182, 195, 205, 209, 218, 231, 234, 259, 280, 286, 290, 295, 299, 315, 340, 344, 376, 386, 390, 399, 408, 415, 425, 440, 476, 489, 507, 511, 520, 525, 536, 561, 570, 589, 597, 646, 651, 655, 664, 670, 680
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 12 2017

Keywords

Crossrefs

Programs

  • Maple
    M:= 20: # to get all terms <= A000330(M)
    sqp:= [seq(k*(k+1)*(2*k+1)/6, k=1..M)]:
    sort(convert(select(`<=`, {seq(seq(sqp[i]+sqp[j], j=1..i),i=1..M-1)},sqp[M]),list)); # Robert Israel, Jun 12 2017
  • Mathematica
    nmax = 700; f[x_] := Sum[x^(k (k + 1) (2 k + 1)/6), {k, 1, 20}]^2; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, nmax}]]

A185979 Numbers which are the sum of two positive triangular numbers in more than one way.

Original entry on oeis.org

16, 31, 42, 46, 51, 56, 72, 76, 81, 94, 106, 111, 121, 123, 126, 133, 141, 146, 156, 157, 172, 174, 181, 186, 191, 196, 198, 211, 216, 225, 226, 231, 237, 241, 246, 256, 259, 268, 276, 281, 286, 289, 291, 297, 301, 306, 310, 315, 321, 326, 328, 331, 336, 342, 346, 354, 361, 366, 367
Offset: 1

Views

Author

Wolfdieter Lang, Feb 15 2011

Keywords

Comments

This is a subsequence of A020756 (sums of two triangular numbers).
This is also a subsequence of A051533 (sums of two positive triangular numbers). This is not a subsequence of A185978 (nontriangular numbers as sums of (positive) triangular numbers). E.g., a(32)=231 is missing there because 231=A000217(21). See A185980.
For the numbers which are sums of two positive triangular numbers in exactly two ways see A064816.
The first number which can be written in exactly three ways as sums of positive triangular numbers is 81.
a(n) gives the positions where A052344 entries are >= 2: A052344(a(n)) >= 2.

Examples

			16 = 15 + 1 = 10 + 6.
81 = 45 + 36 = 66 + 15 = 78 + 3.
231= 210 + 21 = 153 + 78
		

Crossrefs

Showing 1-10 of 19 results. Next