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

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

A093519 Numbers with no representation as the sum of two (not necessarily distinct) generalized pentagonal numbers.

Original entry on oeis.org

11, 18, 21, 25, 32, 39, 43, 46, 49, 54, 60, 65, 67, 68, 74, 76, 81, 87, 88, 90, 95, 98, 106, 109, 111, 113, 116, 120, 123, 125, 130, 136, 137, 142, 144, 153, 158, 159, 163, 164, 165, 172, 173, 175, 179, 182, 186, 193, 197, 201, 204, 205, 207, 208, 214, 219, 220
Offset: 1

Views

Author

Jon Perry, Mar 29 2004

Keywords

Crossrefs

Cf. A001318 (generalized pentagonal numbers), A093518.
Cf. A204382.

Programs

  • Maple
    GP:= [0, seq(op([m*(3*m-1)/2, m*(3*m+1)/2]), m=1..50)]:
    N:= GP[-1]:
    V:= Array(0..N, datatype=integer[4]):
    for i from 1 to nops(GP) do
    for j from 1 to i do
       r:= GP[i]+GP[j];
       if r > N then break fi;
       V[r]:= V[r]+1
    od od:
    select(t -> V[t] = 0, [$0..N]); # Robert Israel, Feb 26 2025

Extensions

Definition clarified by Robert Israel, Feb 26 2025

A290943 Number of ways to write n as an ordered sum of 3 generalized pentagonal numbers (A001318).

Original entry on oeis.org

1, 3, 6, 7, 6, 6, 7, 12, 12, 12, 9, 6, 12, 12, 18, 13, 12, 18, 12, 18, 12, 13, 18, 12, 24, 12, 12, 24, 21, 30, 12, 18, 18, 12, 24, 18, 19, 18, 24, 24, 18, 24, 36, 24, 18, 19, 18, 24, 24, 30, 18, 12, 36, 30, 24, 21, 18, 36, 24, 36, 24, 12, 36, 36, 36, 18, 25, 30, 24, 24, 24, 30, 24, 36, 30, 24
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 14 2017

Keywords

Comments

Conjecture: every number is the sum of at most k - 4 generalized k-gonal numbers (for k >= 8).
In 1830, Legendre showed that for each integer m>4 every integer N >= 28*(m-2)^3 can be written as the sum of five m-gonal numbers. In 1994 R. K. Guy proved that each natural number is the sum of three generalized pentagonal numbers. In a 2016 paper Zhi-Wei Sun proved that each natural number is the sum of four octagonal numbers. - Zhi-Wei Sun, Oct 03 2020

Examples

			a(6) = 7 because we have [5, 1, 0], [5, 0, 1], [2, 2, 2], [1, 5, 0], [1, 0, 5], [0, 5, 1] and [0, 1, 5].
		

Crossrefs

Programs

  • Maple
    N:= 100;
    bds:= [fsolve(k*(3*k-1)/2 = N)];
    G:= add(x^(k*(3*k-1)/2),k=floor(min(bds))..ceil(max(bds)))^3:
    seq(coeff(G,x,n),n=0..N); # Robert Israel, Aug 16 2017
  • Mathematica
    nmax = 75; CoefficientList[Series[Sum[x^(k (3 k - 1)/2), {k, -nmax, nmax}]^3, {x, 0, nmax}], x]
    nmax = 75; CoefficientList[Series[Sum[x^((6 k^2 + 6 k + (-1)^(k + 1) (2 k + 1) + 1)/16), {k, 0, nmax}]^3, {x, 0, nmax}], x]
    nmax = 75; CoefficientList[Series[EllipticTheta[4, 0, x^3]^3/QPochhammer[x, x^2]^3, {x, 0, nmax}], x]

Formula

G.f.: (Sum_{k=-infinity..infinity} x^(k*(3*k-1)/2))^3.
G.f.: (Sum_{k>=0} x^A001318(k))^3.
G.f.: Product_{n >= 1} ( (1 - q^(3*n))/(1 - q^n + q^(2*n)) )^3. - Peter Bala, Jan 04 2025

A381535 a(n) is the least nonnegative number that can be represented as the sum of two (not necessarily distinct) generalized pentagonal numbers in exactly n ways.

Original entry on oeis.org

11, 0, 2, 27, 92, 352, 1002, 16927, 2302, 7827, 25052, 220052, 13352, 1487552, 101752, 195677, 85177, 137532552, 173577
Offset: 0

Views

Author

Robert Israel, Feb 26 2025

Keywords

Comments

a(n) is the least k >= 0 such that A093518(k) = n.
a(17) > 5.4 * 10^7 if it exists.
From Pontus von Brömssen, Feb 28 2025: (Start)
a(19) > 3*10^9 if it exists.
After a(19), the following are all terms below 3*10^9:
n | a(n)
---+-----------
20 | 333802
21 | 4891927
22 | 391438802
23 | 2543802
24 | 494027
25 | 55039427
27 | 3764827
28 | 8345052
30 | 4339427
32 | 2737177
35 | 1375985677
36 | 6422352
38 | 429902552
40 | 12350677
41 | 85573502
42 | 108485677
45 | 94120677
48 | 29014077
50 | 733363177
54 | 120983227
56 | 308766927
60 | 160558802
63 | 2353016927
64 | 101275552
68 | 2139337552
72 | 344336877
80 | 725351927
96 | 1073520852
(End)

Examples

			a(3) = 27 because 27 = 1 + 26 = 5 + 22 = 12 + 15 has 3 representations as the sum of two generalized pentagonal numbers, and no smaller number works.
		

Crossrefs

Programs

  • Maple
    GP:= [0,seq(op([m*(3*m-1)/2, m*(3*m+1)/2]),m=1..2000)]:
    N:= GP[-1]:
    V:= Array(0..N, datatype=integer[4]):
    for i from 1 to nops(GP) do
    for j from 1 to i do
       r:= GP[i]+GP[j];
       if r > N then break fi;
       V[r]:= V[r]+1
    od od:
    W:= Array(0..16): count:= 0:
    for i from 1 to N while count < 17 do
      v:= V[i]; if v <= 16 and W[v] = 0 then W[v]:= i; count:= count + 1 fi
    od:
    W[1]:= 0:
    convert(W,list);

Formula

A093518(a(n)) = n.

Extensions

a(17)-a(18) from Pontus von Brömssen, Feb 28 2025
Showing 1-4 of 4 results.