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 10 results.

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

A052347 Record values reached in A052343 and A052344.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 18, 20, 24, 32, 36, 40, 48, 64, 72, 80, 96, 108, 128, 144, 160, 192, 216
Offset: 1

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Crossrefs

Extensions

a(25)-a(26) from Donovan Johnson, Jun 26 2010
a(27)-a(28) from Donovan Johnson, Mar 20 2013

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

A319797 Number T(n,k) of partitions of n into exactly k positive triangular numbers; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Sep 28 2018

Keywords

Comments

Equals A181506 when the first column is removed. - Georg Fischer, Jul 26 2023

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 1, 0, 1;
  0, 0, 1, 0, 1;
  0, 0, 0, 1, 0, 1;
  0, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 1, 0, 1, 0, 1;
  0, 0, 0, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 2, 1, 1, 1, 1, 1, 0, 1, 0, 1;
		

Crossrefs

Columns k=0-10 give: A000007, A010054 (for n>0), A052344, A063993, A319814, A319815, A319816, A319817, A319818, A319819, A319820.
Row sums give A007294.
T(2n,n) gives A319799.

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) option remember; `if`(n=0 or i=1, x^n,
          b(n, h(i-1))+expand(x*b(n-i, h(min(n-i, i)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, h(n))):
    seq(T(n), n=0..20);
  • Mathematica
    h[n_] := h[n] = If[n < 1, 0, If[IntegerQ @ Sqrt[8*n + 1], n, h[n - 1]]];
    b[n_, i_] := b[n, i] = If[n == 0 || i == 1, x^n, b[n, h[i - 1]] + Expand[ x*b[n - i, h[Min[n - i, i]]]]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, n}]& @ b[n, h[n]];
    Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, May 27 2019, after Alois P. Heinz *)

Formula

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

A307597 Number of partitions of n into 2 distinct positive triangular numbers.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 17 2019

Keywords

Comments

The greedy inverse (positions of first occurrence of n) starts 0, 4, 16, 81, 471, 2031, 1381, 11781, 6906, 17956, ... - R. J. Mathar, Apr 28 2020

Examples

			a(16) = 2 because we have [15, 1] and [10, 6].
		

Crossrefs

Formula

a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^(k*(k+1)/2)).
a(n) = Sum_{k=1..floor((n-1)/2)} c(k) * c(n-k), where c = A010054. - 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

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

A052348 Indices of A052343 (ways to write n as sum of two triangular numbers) where record values are reached.

Original entry on oeis.org

0, 6, 81, 276, 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

Christian G. Bower, Jan 23 2000

Keywords

Examples

			a(2) = 6 because 6 = 6 + 0 = 3 + 3. a(3) = 81 because 81 = 3 + 78 = 15 + 66 = 36 + 55.
		

Crossrefs

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

Extensions

a(23)-a(26) from Donovan Johnson, May 24 2009
a(27)-a(28) from Donovan Johnson, Mar 20 2013

A052345 Least k such that A052343(k)=n.

Original entry on oeis.org

5, 1, 6, 81, 276, 1056, 1381, 50781, 6906, 17956, 34531, 660156, 40056, 4462656, 305256, 448906, 200281, 412597656, 520731, 12397766113281, 1001406, 11222656, 539550781, 7631406, 1482081, 75865156, 422394133, 8852431, 25035156, 161170959472656
Offset: 0

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Crossrefs

Extensions

a(19) and a(29) from Max Alekseyev, Mar 09 2009
a(19) corrected by Max Alekseyev, Mar 11 2009

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 10 results.