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.

Previous Showing 11-20 of 23 results. Next

A020756 Numbers that are the sum of two triangular numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The possible sums of a square and a promic, i.e., x^2+n(n+1), e.g., 3^2 + 2*3 = 9 + 6 = 15 is present. - Jon Perry, May 28 2003
A052343(a(n)) > 0; union of A118139 and A119345. - Reinhard Zumkeller, May 15 2006
Also union of A051533 and A000217. - Ant King, Nov 29 2010

Crossrefs

Complement of A020757.
Cf. A051533 (sums of two positive triangular numbers), A001481 (sums of two squares), A002378, A000217.
Cf. A052343.

Programs

  • Haskell
    a020756 n = a020756_list !! (n-1)
    a020756_list = filter ((> 0) . a052343) [0..]
    -- Reinhard Zumkeller, Jul 25 2014
  • Mathematica
    q[k_] := If[! Head[Reduce[m (m + 1) + n (n + 1) == 2 k && 0 <= m && 0 <= n, {m, n}, Integers]] === Symbol, k, {}]; DeleteCases[Table[q[i], {i, 0, 108}], {}] (* Ant King, Nov 29 2010 *)
    Take[Union[Total/@Tuples[Accumulate[Range[0,20]],2]],80] (* Harvey P. Dale, May 02 2012 *)
  • PARI
    v=vector(200); vc=0; for (x=0,10, for (y=0,10,v[vc++ ]=x^2+y*(y+1))); v=vecsort(v); v
    
  • PARI
    is(n)=my(f=factor(4*n+1));for(i=1,#f~,if(f[i,1]%4==3 && f[i,2]%2, return(0))); 1 \\ Charles R Greathouse IV, Jul 05 2013
    

Formula

Numbers n such that 4n+1 is the sum of two squares, i.e. such that 4n+1 is in A001481. Hence n is a member if and only if 4n+1 = odd square * product of distinct primes of form 4k+1. (Fred Helenius and others, Dec 18 2004)
Equivalently, we may say that a positive integer n can be partitioned into a sum of two triangular numbers if and only if every 4 k + 3 prime factor in the canonical form of 4 n + 1 occurs with an even exponent. - Ant King, Nov 29 2010
Also, the values of n for which 8n+2 can be partitioned into a sum of two squares of natural numbers. - Ant King, Nov 29 2010
Closed under the operation f(x, y) = 4*x*y + x + y.

Extensions

Entry revised by N. J. A. Sloane, Dec 20 2004

A053603 Number of ways to write n as an ordered sum of two nonzero triangular numbers.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 20 2000

Keywords

Comments

a(A051611(n)) = 0; A051533(a(n)) > 0. - Reinhard Zumkeller, Jun 27 2013

Crossrefs

Programs

  • Haskell
    a053603 n = sum $ map (a010054 . (n -)) $
                      takeWhile (< n) $ tail a000217_list
    -- Reinhard Zumkeller, Jun 27 2013
    
  • Mathematica
    nmax = 100; m0 = 10; A053603 := Table[a[n], {n, 0, nmax}]; Clear[counts]; counts[m_] := counts[m] = (Clear[a]; a[A053603);%20counts%5Bm%20=%20m0%5D;%20counts%5Bm%20=%202*m%5D;%20While%5B%20counts%5Bm%5D%20!=%20counts%5Bm/2%5D,%20m%20=%202*m%5D;%20A053603%20(*%20_Jean-Fran%C3%A7ois%20Alcover">] = 0; Do[k = i*(i+1)/2 + j*(j+1)/2; a[k] = a[k]+1, {i, 1, m}, {j, 1, m}]; A053603); counts[m = m0]; counts[m = 2*m]; While[ counts[m] != counts[m/2], m = 2*m]; A053603 (* _Jean-François Alcover, Sep 05 2013 *)
  • PARI
    istriang(n)={n>0 && issquare(8*n+1);}
    a(n) = { my(t=1, ct=0, j=1); while (tJoerg Arndt, Sep 05 2013

Formula

G.f.: ( Sum_{k>=1} x^(k*(k+1)/2) )^2. - Ilya Gutkovskiy, Dec 24 2016
a(n) = Sum_{k=1..n-1} c(k) * c(n-k), where c(n) = A010054(n). - Wesley Ivan Hurt, Jan 06 2024

A230121 Number of ways to write n = x + y + z (0 < x <= y <= z) such that x*(x+1)/2 + y*(y+1)/2 + z*(z+1)/2 is a triangular number.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 1, 0, 2, 1, 2, 1, 2, 3, 2, 2, 6, 1, 3, 5, 1, 2, 3, 5, 2, 1, 3, 3, 3, 4, 3, 8, 2, 5, 11, 2, 5, 8, 4, 6, 4, 9, 4, 6, 5, 4, 6, 3, 8, 8, 5, 8, 10, 7, 7, 11, 8, 6, 7, 8, 5, 9, 7, 6, 8, 7, 7, 8, 13, 9, 11, 10, 7, 22, 9, 10, 13, 3, 6, 10, 8, 17, 12, 7, 9, 10, 16, 6, 18, 18, 10, 15, 9, 12, 20, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 10 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 except for n = 1, 2, 4, 5, 7, 12. Moreover, for each n = 20, 21, ... there are three distinct positive integers x, y and z with x + y + z = n such that x*(x+1)/2 + y*(y+1)/2 + z*(z+1)/2 is a triangular number.
(ii) A positive integer n cannot be written as x + y + z (x, y, z > 0) with x^2 + y^2 + z^2 a square if and only if n has the form 2^r*3^s or the form 2^r*7, where r and s are nonnegative integers.
(iii) Any integer n > 14 can be written as a + b + c + d, where a, b, c, d are positive integers with a^2 + b^2 + c^2 + d^2 a square. If n > 20 is not among 22, 28, 30, 38, 44, 60, then we may require additionally that a, b, c, d are pairwise distinct.
(iv) For each integer n > 50 not equal to 71, there are positive integers a, b, c, d with a + b + c + d = n such that both a^2 + b^2 and c^2 + d^2 are squares.
Part (ii) and the first assertion in part (iii) were confirmed by Chao Huang and Zhi-Wei Sun in 2021. - Zhi-Wei Sun, May 09 2021

Examples

			a(16) = 1 since 16 = 3 + 6 + 7 and 3*4/2 + 6*7/2 + 7*8/2 = 55 = 10*11/2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    T[n_]:=n(n+1)/2
    a[n_]:=Sum[If[SQ[8(T[i]+T[j]+T[n-i-j])+1],1,0],{i,1,n/3},{j,i,(n-i)/2}]
    Table[a[n],{n,1,100}]
  • PARI
    a(n)=my(t=(n+1)*n/2,s);sum(x=1,n\3,s=t-n--*x;sum(y=x,n\2,is_A000217(s-(n-y)*y))) \\ - M. F. Hasler, Oct 11 2013

A052344 Number of ways to write n as the unordered sum of two nonzero triangular numbers.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 2, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 2, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1, 2, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 2, 1, 0, 0, 2, 0, 0, 1, 0, 3, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 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 to write 8*n+2 as the unordered sum of two odd squares > 1. - Robert Israel, Feb 24 2016
Number of partitions of 2n into two promic numbers > 1. - Wesley Ivan Hurt, Jun 09 2021

Crossrefs

Programs

  • Maple
    G:= (1/8)*(JacobiTheta2(0, sqrt(q))^2-4*JacobiTheta2(0, sqrt(q))*q^(1/8)+2*JacobiTheta2(0, q))/q^(1/4):
    S:= series(G,q,1001):
    seq(coeff(S,q,j),j=0..1000); # Robert Israel, Feb 24 2016
  • Mathematica
    nn=150; tri=Accumulate[Range[nn]]; t=Table[0, {tri[[-1]]}]; Do[n=tri[[i]]+tri[[j]]; If[n <= tri[[-1]], t[[n]]++], {i,nn}, {j,i}]; t=Prepend[t,0]

Formula

G.f.: (Theta_2(sqrt(x))^2 - 4*x^(1/8)*Theta_2(sqrt(x)) + 2*Theta_2(x))/(8*x^(1/4)) where Theta_2 is a Jacobi theta function. - Robert Israel, Feb 24 2016
a(n) = Sum_{k=1..n} c(k) * c(2*n-k), where c(n) is the characteristic function of promic numbers (A005369). - Wesley Ivan Hurt, Jun 09 2021
a(n) = Sum_{k=1..floor(n/2)} c(k) * c(n-k), where c = A010054. - Wesley Ivan Hurt, Jan 06 2024

A053587 Indices of A052344 (ways to write n as sum of two nonzero triangular numbers) where record values are reached.

Original entry on oeis.org

2, 16, 81, 471, 1056, 1381, 6906, 17956, 34531, 40056, 200281, 520731, 1001406, 1482081, 7410406, 19267056, 37052031, 60765331, 303826656, 789949306, 1519133281, 3220562556, 13429138206, 16102812781, 41867313231, 80514063906, 196454315931, 711744324931
Offset: 1

Views

Author

Jeremy Rouse, Jan 19 2000

Keywords

Comments

The subsequence of primes begins: 2, 1381, 1519133281 [Jonathan Vos Post, Feb 01 2011].

Examples

			The order of the terms is ignored when deciding in how many ways the sum can be expressed. For example, a(2) does not equal 9, although 9 = 3 + 6 = 6 + 3.
a(2) = 16 because 16 = 1 + 15 = 6 + 10. a(3) = 81 because 81 = 3 + 78 = 15 + 66 = 36 + 55.
		

Crossrefs

Probably differs from A052348 only at n=1, 2, 4.

Extensions

More terms from Christian G. Bower, Jan 23 2000
a(25)-a(26) from Donovan Johnson, Jun 26 2010
a(27)-a(28) from Donovan Johnson, Mar 20 2013

A052346 Smallest number which is the sum of two positive triangular numbers in exactly n different ways.

Original entry on oeis.org

1, 2, 16, 81, 471, 1056, 1381, 11781, 6906, 17956, 34531, 123256, 40056, 4462656, 305256, 448906, 200281, 1957231, 520731, 10563906, 1001406, 11222656, 539550781, 3454506, 1482081, 75865156, 7172606106, 8852431, 25035156, 334020781, 13018281, 38531031, 7410406, 7014160156
Offset: 0

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Comments

From Chai Wah Wu, Oct 20 2023: (Start)
Other terms:
a(35) = 42980356
a(36) = 19267056
a(38) = 1289707656
a(39) = 2782318906
a(40) = 37052031
a(41) = 256720506
a(42) = 325457031
a(45) = 221310781
a(47) = 550240551
a(48) = 60765331
a(50) = 2200089531
a(54) = 327539956
a(56) = 926300781
a(59) = 7629645156
a(60) = 481676406
a(63) = 4598740656
a(64) = 303826656
a(68) = 6418012656
a(71) = 4579579956
a(72) = 789949306
a(80) = 1519133281
a(81) = 9498658731
a(84) = 12041910156
a(90) = 8188498906
a(96) = 3220562556
a(108) = 13429138206
(End)

Examples

			a(4) = 471 because 471 is the sum of two positive triangular numbers in exactly 4 different ways (as 300+171, 351+120, 435+36, and 465 + 6), and there is no smaller number that has this property.
		

Crossrefs

Extensions

a(27), a(28) = 8852431, 25035156; a(26) not yet found
a(26) from Donovan Johnson, Nov 17 2008
Name edited (added the qualifier "positive"), example edited, and a(29)-a(32) added by Jon E. Schoenfield, Jul 16 2017
a(33) from Chai Wah Wu, Oct 20 2023

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

A224928 Numbers of pairs {x, y} such that x <= y and triangular(x) + triangular(y) = 2^n.

Original entry on oeis.org

1, 1, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 4, 0, 1, 0, 8, 0, 2, 0, 4, 0, 4, 0, 8, 0, 2, 0, 24, 0, 2, 0, 8, 0, 8, 0, 8, 0, 2, 0, 32, 0, 4, 0, 16, 0, 4, 0, 32, 0, 4, 0, 32, 0, 4, 0, 4, 0, 8, 0, 16, 0, 2, 0, 32, 0, 6, 0, 48, 0, 16, 0, 16, 0, 8, 0, 384, 0, 4, 0, 16, 0, 16, 0, 16, 0, 8, 0, 768, 0, 2, 0, 8, 0, 4, 0, 32, 0, 32, 0, 256
Offset: 0

Views

Author

Alex Ratushnyak, May 08 2013

Keywords

Comments

Conjectures:
1. a(n) = 0 for odd n > 1.
2. a(n) is even for even n > 14.

Examples

			2^1 = 1 + 1, the only representation of 2 as a sum of two triangular numbers, so a(1)=1.
2^4 = 16 = 1+15 = 6+10, two representations, so a(4) = 2.
2^8 = 256 = 3+253 = 66+190 = 120+136, so a(8) = 3.
2^12 = 4096 = 1+4095 = 91+4005 = 1540+2556 = 2016+2080, so a(12) = 4.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 isTriangular(U64 a) {      // ! Must be a <= (1<<63)
        U64 s = sqrt(a*2);
        if (a>=(1ULL<<63)) {
            if (a==(1ULL<<63)) return 0;
            printf("Error: a = %llu\n", a), exit(1);
        }
        return (s*(s+1)/2 == a);
    }
    int main() {
      U64 c, n, x, tx;
      for (n = 1; n; n+=n) {
        for (c = x = tx = 0; tx*2 <= n; ++x, tx+=x)
          if (isTriangular(n - tx))
            ++c;//, printf("(%llu+%llu) ", tx, n-tx);
        printf("%llu, ", c);
      }
      return 0;
    }
    
  • PARI
    A008441(n) = if(!n,n,sumdiv(4*n + 1, d, (d%4==1) - (d%4==3)));
    A052343(n) = if(!n,1,my(u=A008441(n)); ((u\2)+(u%2)));
    A224928(n) = A052343(2^n); \\ Antti Karttunen, May 24 2021

Formula

a(n) = A052343(2^n).

Extensions

More terms from Antti Karttunen, May 24 2021

A347627 Number of partitions of n into at most 4 triangular numbers.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 2, 2, 3, 3, 2, 4, 4, 2, 4, 4, 3, 5, 4, 3, 5, 6, 4, 6, 4, 4, 6, 6, 4, 6, 8, 5, 7, 6, 4, 8, 8, 6, 6, 8, 6, 8, 8, 6, 9, 9, 6, 10, 9, 6, 10, 10, 6, 8, 10, 7, 11, 13, 8, 9, 10, 10, 10, 10, 7, 13, 14, 9, 10, 10, 10, 13, 14, 8, 10
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 09 2021

Keywords

Crossrefs

Previous Showing 11-20 of 23 results. Next