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

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

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

A053614 Numbers that are not the sum of distinct triangular numbers.

Original entry on oeis.org

2, 5, 8, 12, 23, 33
Offset: 1

Views

Author

Jud McCranie, Mar 19 2000

Keywords

Comments

The Mathematica program first computes A024940, the number of partitions of n into distinct triangular numbers. Then it finds those n having zero such partitions. It appears that A024940 grows exponentially, which would preclude additional terms in this sequence. - T. D. Noe, Jul 24 2006, Jan 05 2009

Examples

			a(2) = 5: the 7 partitions of 5 are 5, 4+1, 3+2, 3+1+1, 2+2+1, 2+1+1+1, 1+1+1+1+1. Among those the distinct ones are 5, 4+1, 3+2. None contains all distinct triangular numbers.
12 is a term as it is not a sum of 1, 3, 6 or 10 taken at most once.
		

References

  • Joe Roberts, Lure of the Integers, The Mathematical Association of America, 1992, page 184, entry 33.
  • David Wells in "The Penguin Dictionary of Curious and Interesting Numbers, Revised Edition, page 94, states that "33 is the largest number that is not the sum of distinct triangular numbers".

Crossrefs

Cf. A025524 (number of numbers not the sum of distinct n-th-order polygonal numbers)
Cf. A007419 (largest number not the sum of distinct n-th-order polygonal numbers)
Cf. A001422, A121405 (corresponding sequences for square and pentagonal numbers)

Programs

  • Mathematica
    nn=100; t=Rest[CoefficientList[Series[Product[(1+x^(k*(k+1)/2)), {k,nn}], {x,0,nn(nn+1)/2}], x]]; Flatten[Position[t,0]] (* T. D. Noe, Jul 24 2006 *)

Formula

Complement of A061208.

Extensions

Entry revised by N. J. A. Sloane, Jul 23 2006

A061336 Smallest number of triangular numbers which sum to n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Apr 25 2001

Keywords

Comments

a(n)=3 if n=5 or 8 mod 9, since triangular numbers are {0,1,3,6} mod 9.
From Bernard Schott, Jul 16 2022: (Start)
In September 1636, Fermat, in a letter to Mersenne, made the statement that every number is a sum of at most three triangular numbers. This was proved by Gauss, who noted this event in his diary on July 10 1796 with the notation:
EYPHKA! num = DELTA + DELTA + DELTA (where Y is in fact the Greek letter Upsilon and DELTA is the Greek letter of that name).
This proof was published in his book Disquisitiones Arithmeticae, Leipzig, 1801. (End)

Examples

			a(3)=1 since 3=3, a(4)=2 since 4=1+3, a(5)=3 since 5=1+1+3, with 1 and 3 being triangular.
		

References

  • Elena Deza and Michel Marie Deza, Fermat's polygonal number theorem, Figurate numbers, World Scientific Publishing (2012), Chapter 5, pp. 313-377.
  • C. F. Gauss, Disquisitiones Arithmeticae, Yale University Press, 1966, New Haven and London, p. 342, art. 293.

Crossrefs

Cf. A100878 (analog for A000326), A104246 (analog for A000292), A283365 (analog for A000332), A283370 (analog for A000389).

Programs

  • Mathematica
    t[n_]:=n*(n+1)/2; a[0]=0; a[n_]:=Block[ {k=1, tt= t/@ Range[Sqrt[2*n]]}, Off[IntegerPartitions::take]; While[{} == IntegerPartitions[n, {k}, tt, 1], k++]; k]; a/@ Range[0, 104] (* Giovanni Resta, Jun 09 2015 *)
  • PARI
    \\ see A283370 for generic code, working but not optimized for this case of triangular numbers. - M. F. Hasler, Mar 06 2017
    
  • PARI
    a(n)=my(m=n%9,f); if(m==5 || m==8, return(3)); f=factor(4*n+1); for(i=1,#f~, if(f[i,2]%2 && f[i,1]%4==3, return(3))); if(ispolygonal(n,3), n>0, 2) \\ Charles R Greathouse IV, Mar 17 2022

Formula

a(n) = 0 if n=0, otherwise 1 if n is in A000217, otherwise 2 if n is in A051533, otherwise 3 in which case n is in A020757.
a(n) <= 3 (proposed by Fermat and proved by Gauss). - Bernard Schott, Jul 16 2022

A302057 Numbers k such that the coefficient of x^k in the expansion of Product_{j>=1} (1 - x^j)^5 is zero.

Original entry on oeis.org

1560, 1802, 1838, 2318, 2690, 3174, 3742, 3925, 4348, 4710, 4854, 5002, 5092, 5210, 7484, 7615, 8796, 8846, 9500, 10345, 12110, 14178, 14972, 16203, 18010, 19314, 20207, 20406, 20679, 24566, 25231, 27403, 27532, 28361, 31567, 31573, 35610, 35795, 37347
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 31 2018

Keywords

Comments

Numbers k such that number of partitions of k into an even number of distinct parts equals number of partitions of k into an odd number of distinct parts, with 5 types of each part.

Crossrefs

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), this sequence (m = 5), A020757 (m = 6), A322043 (m = 15).
Cf. A000728.

Programs

  • Mathematica
    Flatten[Position[nmax = 38000; Rest[CoefficientList[Series[QPochhammer[x]^5, {x, 0, nmax}], x]], 0]]
    Flatten[Position[nmax = 38000; Rest[CoefficientList[Series[Sum[(-1)^j x^(j (3 j + 1)/2), {j, -nmax, nmax}]^5, {x, 0, nmax}], x]], 0]]
    Flatten[Position[nmax = 38000; Rest[CoefficientList[Series[Exp[-5 Sum[DivisorSigma[1, j] x^j/j, {j, 1, nmax}]], {x, 0, nmax}], x]], 0]]
    (* 4th program: *)
    sigma[k_] := sigma[k] = DivisorSigma[1, k];
    a[0] = 1; a[n_] := a[n] = -5/n Sum[sigma[k] a[n-k], {k, 1, n}];
    Reap[For[k = 1, k <= 10^5, k++, If[a[k] == 0, Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Dec 20 2018 *)
  • PARI
    x='x+O('x^30000); v=Vec(eta(x)^5 - 1); for(k=1, #v, if(v[k]==0, print1(k, ", "))); \\ Altug Alkan, Mar 31 2018, after Joerg Arndt at A213250

A213250 Numbers n such that the coefficient of x^n in the expansion of Product_{k>=1} (1-x^k)^2 is zero.

Original entry on oeis.org

7, 11, 12, 17, 18, 21, 22, 25, 32, 37, 39, 41, 42, 43, 46, 47, 49, 54, 57, 58, 60, 62, 65, 67, 68, 72, 74, 75, 76, 81, 82, 87, 88, 90, 92, 95, 97, 98, 99, 106, 107, 109, 111, 112, 113, 116, 117, 120, 122, 123, 125, 126, 128, 130, 132, 136, 137
Offset: 1

Views

Author

William J. Keith, Jun 07 2012

Keywords

Comments

Indices of zero entries in A002107.
Asymptotic density is 1.
Contains A093519, numbers with no representation as sum of two or fewer pentagonal numbers.

Crossrefs

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), this sequence (m=2), A014132 (m=3), A302056 (m=4), A302057 (m=5), A020757 (m=6), A322043 (m=15).

Programs

  • Julia
    # DedekindEta is defined in A000594.
    function A213250List(upto)
        eta = DedekindEta(upto, 2)
        [n - 1 for (n, z) in enumerate(eta) if z == 0] end
    println(A213250List(140))  # Peter Luschny, Jul 19 2022
  • Mathematica
    LongPoly = Series[Product[1 - q^n, {n, 1, 300}]^2, {q, 0, 300}]; ZeroTable = {}; For[i = 1, i < 301, i++, If[Coefficient[LongPoly, q^i] == 0, AppendTo[ZeroTable, i]]]; ZeroTable
  • PARI
    x='x+O('x^200);
    v=Vec(eta(x)^2 - 1);
    for(k=1,#v,if(v[k]==0,print1(k,", ")));
    /* Joerg Arndt, Jun 07 2012 */
    

A302056 Numbers k such that the coefficient of x^k in the expansion of Product_{j>=1} (1 - x^j)^4 is zero.

Original entry on oeis.org

9, 14, 19, 24, 31, 34, 39, 42, 44, 49, 53, 59, 64, 65, 69, 74, 75, 82, 84, 86, 89, 94, 97, 99, 108, 109, 111, 114, 116, 119, 124, 130, 133, 134, 139, 144, 149, 150, 152, 157, 159, 163, 164, 167, 169, 174, 180, 184, 185, 189, 194, 196, 198, 199, 201, 203, 207, 209
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 31 2018

Keywords

Comments

Numbers k such that number of partitions of k into an even number of distinct parts equals number of partitions of k into an odd number of distinct parts, with 4 types of each part.
From Jianing Song, Feb 09 2021: (Start)
The following are equivalent:
- k is in this sequence;
- At least one prime congruent to 5 modulo 6 divides 6*k+1 with an odd exponent;
- 6*k+1 is not of the form x^2 + x*y + y^2, i.e., 6*k+1 is in A034020. (End)

Crossrefs

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), this sequence (m = 4), A302057 (m = 5), A020757 (m = 6), A322430 (m = 8), A322431 (m = 10), A322432 (m = 14), A322043 (m = 15), A322433 (m = 26).

Programs

  • Mathematica
    Flatten[Position[nmax = 210; Rest[CoefficientList[Series[QPochhammer[x]^4, {x, 0, nmax}], x]], 0]]
    Flatten[Position[nmax = 210; Rest[CoefficientList[Series[Sum[(-1)^j x^(j (3 j + 1)/2), {j, -nmax, nmax}]^4, {x, 0, nmax}], x]], 0]]
    Flatten[Position[nmax = 210; Rest[CoefficientList[Series[Exp[-4 Sum[DivisorSigma[1, j] x^j/j, {j, 1, nmax}]], {x, 0, nmax}], x]], 0]]
  • PARI
    x='x+O('x^999); v=Vec(eta(x)^4 - 1); for(k=1, #v, if(v[k]==0, print1(k, ", "))); \\ Altug Alkan, Mar 31 2018, after Joerg Arndt at A213250

A322430 Numbers k such that the coefficient of x^k in the expansion of Product_{j>=1} (1-x^j)^8 is zero.

Original entry on oeis.org

3, 7, 11, 13, 15, 18, 19, 23, 27, 28, 29, 31, 35, 38, 39, 43, 45, 47, 48, 51, 53, 55, 59, 61, 62, 63, 67, 68, 71, 73, 75, 77, 78, 79, 83, 84, 87, 88, 91, 93, 95, 98, 99, 103, 106, 107, 109, 111, 113, 115, 117, 118, 119, 123, 125, 127, 128, 130, 131, 135, 138, 139, 141
Offset: 1

Views

Author

Seiichi Manyama, Dec 07 2018

Keywords

Comments

Indices of zero entries in A000731.
Complement of A267137. - Kemoneilwe Thabo Moseki, Dec 12 2019

Crossrefs

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), A020757 (m=6), this sequence (m=8), A322431 (m=10), A322432 (m=14), A322043 (m=15), A322433 (m=26).

Programs

  • PARI
    my(x='x+O('x^160)); Vec(select(x->(x==0), Vec(eta(x)^8 - 1), 1)) \\ Michel Marcus, Dec 08 2018

A322433 Numbers k such that the coefficient of x^k in the expansion of Product_{j>=1} (1-x^j)^26 is zero.

Original entry on oeis.org

9, 20, 31, 42, 43, 53, 64, 66, 75, 86, 89, 97, 108, 112, 119, 135, 136, 141, 152, 158, 163, 171, 174, 181, 183, 185, 196, 204, 206, 207, 218, 227, 229, 230, 240, 241, 250, 262, 273, 277, 284, 289, 295, 296, 306, 311, 317, 319, 324, 328, 339, 342, 348, 350, 361, 365
Offset: 1

Views

Author

Seiichi Manyama, Dec 07 2018

Keywords

Comments

Indices of zero entries in A010831.

Crossrefs

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), A020757 (m=6), A322430 (m=8), A322431 (m=10), A322432 (m=14), A322043 (m=15), this sequence (m=26).

Programs

  • PARI
    my(x='x+O('x^400)); Vec(select(x->(x==0), Vec(eta(x)^26 - 1), 1)) \\ Michel Marcus, Dec 08 2018

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}]], #
    				
Showing 1-10 of 21 results. Next