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

A129654 Number of different ways to represent n as general polygonal number P(m,r) = 1/2*r*((m-2)*r-(m-4)) = n>1, for m,r>1.

Original entry on oeis.org

1, 2, 2, 2, 3, 2, 2, 3, 3, 2, 3, 2, 2, 4, 3, 2, 3, 2, 2, 4, 3, 2, 3, 3, 2, 3, 4, 2, 3, 2, 2, 3, 3, 3, 5, 2, 2, 3, 3, 2, 3, 2, 2, 5, 3, 2, 3, 3, 2, 4, 3, 2, 3, 4, 2, 3, 3, 2, 3, 2, 2, 3, 4, 3, 5, 2, 2, 3, 4, 2, 3, 2, 2, 4, 3, 2, 4, 2, 2, 5, 3, 2, 3, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 3, 4, 2, 2, 3, 4, 2, 3, 2, 2, 5, 3
Offset: 2

Views

Author

Alexander Adamchuk, Apr 27 2007

Keywords

Comments

The indices k of the first appearance of number n in a(k) are listed in A063778(n) = {2,3,6,15,36,225,...} = Least number k>1 such that k could be represented in n different ways as general m-gonal number P(m,r) = 1/2*r*((m-2)*r-(m-4)).
From Gus Wiseman, May 03 2019: (Start)
Also the number of integer partitions of n whose augmented differences are all equal, where the augmented differences aug(y) of an integer partition y of length k are given by aug(y)i = y_i - y{i + 1} + 1 if i < k and aug(y)_k = y_k; for example aug(6,5,5,3,3,3) = (2,1,3,1,1,3). Equivalently, a(n) is the number of integer partitions of n whose differences are all equal to the last part minus one. The Heinz numbers of these partitions are given by A307824. For example, the a(35) = 5 partitions are:
(35)
(23,12)
(11,9,7,5,3)
(8,7,6,5,4,3,2)
(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
(End)

Examples

			a(6) = 3 because 6 = P(2,6) = P(3,3) = P(6,2).
		

Crossrefs

Programs

  • Maple
    A129654 := proc(n) local resul, dvs, i, r, m ;
       dvs := numtheory[divisors](2*n) ;
       resul := 0 ;
       for i from 1 to nops(dvs) do
          r := op(i, dvs) ;
          if r > 1 then
             m := (2*n/r-4+2*r)/(r-1) ;
             if is(m, integer) then
                resul := resul+1 ;
             fi ;
          fi ;
       od ;
       RETURN(resul) ;
    end: # R. J. Mathar, May 14 2007
  • Mathematica
    a[n_] := (dvs = Divisors[2*n]; resul = 0; For[i = 1, i <= Length[dvs], i++, r = dvs[[i]]; If[r > 1, m = (2*n/r-4+2*r)/(r-1); If[IntegerQ[m], resul = resul+1 ] ] ]; resul); Table[a[n], {n, 2, 106}] (* Jean-François Alcover, Sep 13 2012, translated from R. J. Mathar's Maple program *)
    Table[Length[Intersection[Divisors[2 n - 2] + 1, Divisors[2 n]]], {n, 2, 106}] (* Jonathan Sondow, May 09 2014 *)
    atpms[n_]:=Select[Join@@Table[i*Range[k,1,-1],{k,n},{i,0,n}],Total[#+1]==n&];
    Table[Length[atpms[n]],{n,100}] (* Gus Wiseman, May 03 2019 *)
  • PARI
    a(n) = sumdiv(2*n, d, (d>1) && (2*n/d + 2*d - 4) % (d-1) == 0); \\ Daniel Suteu, Dec 22 2018

Formula

a(n) = A177025(n) + 1.
G.f.: x * Sum_{k>=1} x^k / (1 - x^(k*(k + 1)/2)) (conjecture). - Ilya Gutkovskiy, Apr 09 2020

A063778 a(n) = the least integer that is polygonal in exactly n ways.

Original entry on oeis.org

3, 6, 15, 36, 225, 561, 1225, 11935, 11781, 27405, 220780, 203841, 3368925, 4921840, 7316001, 33631521, 142629201, 879207616, 1383958576, 3800798001, 12524486976, 181285005825, 118037679760, 239764947345, 738541591425, 1289707733601, 1559439365121
Offset: 1

Views

Author

David W. Wilson, Aug 16 2001

Keywords

Comments

a(n) has exactly n representations as an m-gonal number P(m,r) = r*((m-2)*r-(m-4))/2, with m>2, r>1.
a(28) > 4*10^12. - Donovan Johnson, Dec 08 2010
From Husnain Raza, Jan 01 2024: (Start)
a(28) <= 14189300403201
a(29) <= 100337325689601
a(30) <= 1735471549713825
a(31) <= 334830950355825
a(32) <= 1473426934890625
a(33) <= 5409964920838401
(End)

Examples

			a(3) = 15 because 15 is the least integer which is polygonal in 3 ways (15 is n-gonal for n = 3, 6, 15).
		

Crossrefs

Cf. A177025 (number of different ways to represent n as a polygonal).
Cf. A129654 (number of different ways to represent n as general polygonal).

Programs

  • Maple
    A063778 := proc(nmax) local a,n,ps ; a := [seq(0,i=1..nmax)] ; n := 1 ; while true do ps := A129654(n) ; if ps > 0 and ps <= nmax and n > 1 then if op(ps,a) = 0 then a := subsop(ps=n,a) ; print(a) ; fi ; fi ; n := n+1 ; end: RETURN(a) ; end: A063778(30) ; # R. J. Mathar, May 14 2007
  • Mathematica
    P[m_, r_] := P[m, r] = r*(4 + m*(r - 1) - 2*r)/2;
    a[n_Integer] := a[n] = Module[{c, r, m, p, f}, p = 0; f = False; While[!f, p++; c = 0; For[m = 3, m <= p, m++, For[r = 1, r <= p, r++, If[p == P[m, r], c++;];];]; If[c == n, f = True;];]; p];
    Table[a[n], {n, 1, 5}] (* Robert P. P. McKone, Jan 02 2024 *)
  • PARI
    a(n) = my(k=3); while (sum(p=3, k, ispolygonal(k, p)) != n, k++); k; \\ Michel Marcus, Aug 17 2024

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 23 2007
a(22)-a(27) from Donovan Johnson, Dec 08 2010

A177029 Numbers that have exactly two different representations as polygonal numbers.

Original entry on oeis.org

6, 9, 10, 12, 16, 18, 22, 24, 25, 27, 30, 33, 34, 35, 39, 40, 42, 46, 48, 49, 52, 54, 57, 58, 60, 63, 65, 69, 72, 76, 82, 84, 85, 87, 88, 90, 92, 93, 94, 95, 99, 102, 106, 108, 114, 115, 118, 121, 123, 124, 125, 129, 130, 132, 133, 138, 142, 147, 150, 155, 159, 160, 162, 166, 168
Offset: 1

Views

Author

Vladimir Shevelev, May 01 2010

Keywords

Comments

Numbers that have only A177025(.)=1 representation are listed by A090467.

Examples

			6 is a triangular and a hexagonal number, but is not any other k-gonal number.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {for (n=1, nn, if (sum(k=3, n, ispolygonal(n, k)) == 2, print1(n, ", ")););} \\ Michel Marcus, Mar 25 2015
    
  • Python
    A177029_list = []
    for m in range(1,10**4):
        n, c = 3, 0
        while n*(n+1) <= 2*m:
            if not 2*(n*(n-2) + m) % (n*(n - 1)):
                c += 1
                if c > 1:
                    break
            n += 1
        if c == 1:
            A177029_list.append(m) # Chai Wah Wu, Jul 28 2016

Formula

{m: A177025(m)=2}.

Extensions

Extended by R. J. Mathar, Aug 15 2010

A177028 Irregular table: row n contains values k (in descending order) for which n is a k-gonal number.

Original entry on oeis.org

3, 4, 5, 6, 3, 7, 8, 9, 4, 10, 3, 11, 12, 5, 13, 14, 15, 6, 3, 16, 4, 17, 18, 7, 19, 20, 21, 8, 3, 22, 5, 23, 24, 9, 25, 4, 26, 27, 10, 28, 6, 3, 29, 30, 11, 31, 32, 33, 12, 34, 7, 35, 5, 36, 13, 4, 3, 37, 38, 39, 14, 40, 8, 41, 42, 15
Offset: 3

Views

Author

Vladimir Shevelev, May 01 2010

Keywords

Comments

Every row begins with n and contains all values of k for which n is a k-gonal number.
The cardinality of row n is A177025(n). In particular, if n is prime, then row n contains only n.

Examples

			The table starts with row n=3 as:
3;
4;
5;
6, 3;
7;
8;
9, 4;
10, 3;
11;
12, 5;
13;
14;
15, 6, 3;
16, 4;
17;
18, 7;
19;
20;
Before n=37, we have row n=36: {36, 13, 4, 3}. Thus 36 is k-gonal for k=3, 4, 13 and 36.
		

Crossrefs

Programs

  • Maple
    P := proc(n,k) n/2*((k-2)*n-k+4) ;end proc:
    A177028 := proc(n) local k ,j,r,kg ; r := {} ; for k from n to 3 by -1 do for j from 1 do kg := P(j,k) ; if kg = n then r := r union {k} ;elif kg > n then break ; end if; end do; end do: sort(convert(r,list),`>`) ; end proc:
    for n from 3 to 20 do print(A177028(n)) ; end do: # R. J. Mathar, Apr 17 2011
  • Mathematica
    nn = 100; t = Table[{}, {nn}]; Do[n = 2; While[p = n*(4 - 2*n - r + n*r)/2; p <= nn, AppendTo[t[[p]], r]; n++], {r, 3, nn}]; Flatten[Reverse /@ t] (* T. D. Noe, Apr 18 2011 *)
  • PARI
    row(n) = my(list = List()); for (k=3, n, if (ispolygonal(n, k), listput(list, k))); Vecrev(list); \\ Michel Marcus, Mar 19 2021
    
  • PARI
    row(n)=my(v=List());fordiv(2*n,k, if(k<2,next); if(k==n, break); my(s=(2*n/k-4+2*k)/(k-1)); if(denominator(s)==1, listput(v,s))); Vec(v) \\ Charles R Greathouse IV, Mar 19 2021

A195527 Integers n that are k-gonal for precisely 3 distinct values of k, where k >= 3.

Original entry on oeis.org

15, 21, 28, 51, 55, 64, 70, 75, 78, 91, 96, 100, 111, 112, 117, 126, 135, 136, 141, 144, 145, 148, 154, 156, 165, 175, 176, 186, 189, 195, 201, 204, 216, 232, 235, 238, 246, 255, 256, 285, 286, 288, 291, 297, 300, 306, 315, 316, 321, 322, 324, 330, 333, 336
Offset: 1

Views

Author

Ant King, Sep 21 2011

Keywords

Comments

See A177025 for number of ways a number can be represented as a polygonal number.

Examples

			21 is in the sequence because it is a triangular number (A000217), an octagonal number (A000567) and an icosihenagonal number (A051873).
		

Crossrefs

Programs

  • Mathematica
    data1=Reduce[1/2 n (n(k-2)+4-k)== # && k>=3 && n>0, {k,n}, Integers]&/@Range[336]; data2=If[Head[#]===And, 1, Length[#]] &/@data1; data3=DeleteCases[Table[If[data2[[k]]==3, k], {k, 1, Length[data2]}], Null]
  • Python
    A195527_list = []
    for m in range(1,10**4):
        n, c = 3, 0
        while n*(n+1) <= 2*m:
            if not 2*(n*(n-2) + m) % (n*(n - 1)):
                c += 1
                if c > 2:
                    break
            n += 1
        if c == 2:
            A195527_list.append(m) # Chai Wah Wu, Jul 28 2016

A195528 Integers n that are k-gonal for precisely 4 distinct values of k, where k >= 3.

Original entry on oeis.org

36, 45, 66, 81, 105, 120, 153, 171, 190, 196, 210, 261, 280, 351, 378, 396, 400, 405, 406, 456, 465, 477, 484, 496, 532, 576, 585, 606, 621, 630, 645, 666, 715, 726, 729, 736, 741, 742, 765, 780, 784, 801, 855, 876, 891, 910, 945, 960, 981, 1015, 1045, 1056
Offset: 1

Views

Author

Ant King, Sep 21 2011

Keywords

Comments

See A177025 for number of ways a number can be represented as a polygonal number.

Examples

			36 is in the sequence because it is a triangular number (A000217), a square number (A000290), a tridecagonal number (A051865), and a 36-gonal number.
		

Crossrefs

Programs

  • Mathematica
    data1=Reduce[1/2 n (n(k-2)+4-k)==# && k>=3 && n>0, {k,n}, Integers]&/@Range[1056]; data2=If[Head[#]===And, 1, Length[#]] &/@data1; data3=DeleteCases[Table[If[data2[[k]]==4, k], {k, 1, Length[data2]}], Null]
  • Python
    A195528_list = []
    for m in range(1,10**4):
        n, c = 3, 0
        while n*(n+1) <= 2*m:
            if not 2*(n*(n-2) + m) % (n*(n - 1)):
                c += 1
                if c > 3:
                    break
            n += 1
        if c == 3:
            A195528_list.append(m) # Chai Wah Wu, Jul 28 2016

A245648 The largest member 'c' of the Pythagorean triples (a,b,c) ordered by increasing c, where the triples consist of a triangular number, a square number and a pentagonal number.

Original entry on oeis.org

5, 15, 145, 2775
Offset: 1

Views

Author

Ivan N. Ianakiev, Jul 28 2014

Keywords

Comments

Next term comes from a triple with c > 10^5.
From Michel Marcus, Apr 08 2021: (Start)
The 4 known triples that satisfy the requisite are [3,4,5], [9,12,15], [100, 105, 145], [900, 2625, 2775].
Let po(n) be A176774(n), the least polygonality of a number.
po([3,4,5]) = [3,4,5]; <-----
po([9,12,15]) = [4,5,3];
po([100,105,145]) = [4,3,5]; <-----
po([900,2625,2775]) = [4,5,3].
So for the 2 highlighted triples, we have a-gonal^2 + b-gonal^2 = c-gonal^2. Are there other Pythagorean triples with the same property?
Let nb(n) be A177025(n) is the number of ways to represent n as a polygonal number.
nb([3,4,5]) = [1,1,1]; <-----
nb([9,12,15]) = [4,5,3];
nb([100,105,145]) = [4,3,5];
nb([900,2625,2775]) = [4,5,3].
So for the highlighted triple, we get [1,1,1]. Are there other Pythagorean triples with the same property? (End)
Regarding the first question by Michel Marcus, if such triple [x,y,z] exists, then z > 10^4. Regarding his second question, if such triple exists, then z > 10^7. - Ivan N. Ianakiev, Dec 16 2021
a(5) > 10^11, if it exists. - Giovanni Resta, Apr 15 2021

Examples

			a(1) = 5 as the first such Pythagorean triple is (3,4,5). The next three triples are (9,12,15), (100,105,145), (900,2625,2775).
		

Crossrefs

Programs

  • Mathematica
    n=10^3;ppt={};list={};pos=1;t[x_]:=(IntegerPart[Sqrt[2*x]])*(IntegerPart[Sqrt[2*x]]+1)/2;ls[x_]:=Length[Sqrt[x]];lis[x_]:=Length[IntegerPart[Sqrt[x]]];lp[x_]:=Length[(Sqrt[24*x+1]+1)/6];lip[x_]:=Length[IntegerPart[(Sqrt[24*x+1]+1)/6]];Do[y=x+1;z=y+1;While[z<=n,While[z^2
    				

A333822 Number of ways to write n as the difference of two k-gonal numbers for k >= 3.

Original entry on oeis.org

1, 3, 3, 5, 4, 6, 4, 8, 5, 7, 6, 8, 5, 10, 7, 9, 6, 8, 6, 13, 8, 8, 7, 12, 6, 12, 8, 10, 9, 10, 7, 13, 8, 12, 10, 13, 6, 13, 9, 12, 8, 10, 8, 17, 11, 10, 10, 14, 8, 16, 9, 10, 9, 14, 10, 19, 9, 8, 10, 14, 7, 16, 12, 19, 12, 12, 7, 14, 12, 12, 11, 14, 8
Offset: 2

Views

Author

Peter Kagey, Apr 06 2020

Keywords

Comments

Records occur at indices 2, 3, 5, 7, 9, 15, 21, 45, 57, 81, 105, 145, 217, 225, 385, 435, 441, 495, 561, 651, 705, 945, 1105, ... - Peter Kagey, Nov 18 2020

Examples

			For n = 7, the a(7) = 6 ways to write 7 as the difference of k-gonal numbers are:
A000217(4) - A000217(2) = 10 -  3 (triangular),
A000217(7) - A000217(6) = 28 - 21 (triangular),
A000290(4) - A000290(3) = 16 -  9 (square),
A000326(3) - A000326(2) = 12 -  5 (pentagonal),
A000566(2) - A000566(0) =  7 -  0 (heptagonal), and
A000567(2) - A000567(1) =  8 -  1 (octagonal).
		

Crossrefs

Cf. A177025.
Analogous sequences for specific values of k: A001227 (k=3), A034178 (k=4), A333815 (k=5), A333816 (k=6), A333817 (k=7), A333818 (k=8).

Programs

  • Mathematica
    b := 74
    CoefficientList[
    Series[Sum[
       Sum[x^(k*(p*k - (p - 2))/2)/(1 - x^(p*k)), {k, 1, b}] - x, {p, 1,
        b - 1}], {x, 0, b}], x]

Formula

G.f.: Sum_{m>=1} (-x + Sum_{k>=1} x^A139601(m-1,k)/(1 - x^(m*k))).

A333836 Number of ways to write n as the difference of two positive k-gonal numbers for k >= 3.

Original entry on oeis.org

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

Views

Author

Peter Kagey, Apr 07 2020

Keywords

Comments

Records occur at indices 1, 2, 3, 5, 7, 9, 13, 17, 21, 33, 37, 45, 57, 105, 145, 217, 225, 273, 385, 495, 561, 651, 705, 945, 1105, ... - Peter Kagey, Nov 18 2020

Examples

			The a(9) = 6 ways of writing 9 as the difference of two k-gonal numbers are:
A000217(4) - A000217(1) = 10 -  1 (triangular),
A000217(5) - A000217(3) = 15 -  6 (triangular),
A000217(9) - A000217(8) = 45 - 36 (triangular),
A000290(5) - A000290(4) = 25 - 16 (square),
A000384(3) - A000384(2) = 15 -  6 (hexagonal), and
A001107(2) - A001107(1) = 10 -  1 (10-gonal).
		

Crossrefs

Programs

  • Mathematica
    b := 74
    CoefficientList[
    Series[Sum[
       Sum[x^(k*(p*k - (p - 2))/2)*x^(p*k)/(1 - x^(p*k)), {k, 1, b}], {p,
        1, b - 1}], {x, 0, b}], x]

Formula

a(n) = A333822(n) - A177025(n) for n > 2.

A342550 For n>=3, a(n) is the sum of the indices of n seen as an m-gonal number.

Original entry on oeis.org

2, 2, 2, 5, 2, 2, 5, 6, 2, 5, 2, 2, 10, 6, 2, 5, 2, 2, 11, 6, 2, 5, 7, 2, 5, 13, 2, 5, 2, 2, 5, 6, 7, 19, 2, 2, 5, 6, 2, 5, 2, 2, 19, 6, 2, 5, 9, 2, 11, 6, 2, 5, 17, 2, 5, 6, 2, 5, 2, 2, 5, 14, 7, 22, 2, 2, 5, 13, 2, 5, 2, 2, 10, 6, 2, 17, 2, 2, 20, 6, 2, 5, 7, 2, 5
Offset: 3

Views

Author

Michel Marcus, Mar 27 2021

Keywords

Comments

This sum is constituted of A177025(n) terms related to the n-row of A177028 triangle.
For m in A090467, a(m) = 2.
By definition, a(n) can never be equal to 3 or 4.
Up to 10^7, no n has been found with a(n) = 8, 12 or 18.

Examples

			15 is the 5th triangular, the 3rd hexagonal and the 2nd 15-gonal, so a(15) = 5+3+2 = 10.
		

Crossrefs

Programs

  • PARI
    row(n) = my(v=List()); fordiv(2*n, k, if(k<2, next); if(k==n, break); my(s=(2*n/k-4+2*k)/(k-1)); if(denominator(s)==1, listput(v, s))); Vecrev(v); \\ A177028
    a(n) = my(v=row(n), s=0); for (k=1, #v, if ((v[k]>2) && ispolygonal(n, v[k], &i), s += i)); s;
Showing 1-10 of 12 results. Next