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

A176774 Smallest polygonality of n = smallest integer m>=3 such that n is m-gonal number.

Original entry on oeis.org

3, 4, 5, 3, 7, 8, 4, 3, 11, 5, 13, 14, 3, 4, 17, 7, 19, 20, 3, 5, 23, 9, 4, 26, 10, 3, 29, 11, 31, 32, 12, 7, 5, 3, 37, 38, 14, 8, 41, 15, 43, 44, 3, 9, 47, 17, 4, 50, 5, 10, 53, 19, 3, 56, 20, 11, 59, 21, 61, 62, 22, 4, 8, 3, 67, 68, 24, 5, 71, 25, 73, 74, 9, 14, 77, 3, 79, 80, 4, 15, 83
Offset: 3

Views

Author

Max Alekseyev, Apr 25 2010

Keywords

Comments

A176775(n) gives the index of n as a(n)-gonal number.
Since n is the second n-gonal number, a(n) <= n.
Furthermore, a(n)=n iff A176775(n)=2.

Examples

			a(12) = 5 since 12 is a pentagonal number, but not a square or triangular number. - _Michael B. Porter_, Jul 16 2016
		

Crossrefs

Programs

  • Mathematica
    a[n_] := (m = 3; While[Reduce[k >= 1 && n == k (k (m - 2) - m + 4)/2, k, Integers] == False, m++]; m); Table[a[n], {n, 3, 100}] (* Jean-François Alcover, Sep 04 2016 *)
  • PARI
    a(n) = {k=3; while (! ispolygonal(n, k), k++); k;} \\ Michel Marcus, Mar 25 2015
    
  • Python
    from _future_ import division
    from gmpy2 import isqrt
    def A176774(n):
        k = (isqrt(8*n+1)-1)//2
        while k >= 2:
            a, b = divmod(2*(k*(k-2)+n),k*(k-1))
            if not b:
                return a
            k -= 1 # Chai Wah Wu, Jul 28 2016

A090466 Regular figurative or polygonal numbers of order greater than 2.

Original entry on oeis.org

6, 9, 10, 12, 15, 16, 18, 21, 22, 24, 25, 27, 28, 30, 33, 34, 35, 36, 39, 40, 42, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 63, 64, 65, 66, 69, 70, 72, 75, 76, 78, 81, 82, 84, 85, 87, 88, 90, 91, 92, 93, 94, 95, 96, 99, 100, 102, 105, 106, 108, 111, 112, 114, 115, 117, 118
Offset: 1

Views

Author

Robert G. Wilson v, Dec 01 2003

Keywords

Comments

The sorted k-gonal numbers of order greater than 2. If one were to include either the rank 2 or the 2-gonal numbers, then every number would appear.
Number of terms less than or equal to 10^k for k = 1,2,3,...: 3, 57, 622, 6357, 63889, 639946, 6402325, 64032121, 640349979, 6403587409, 64036148166, 640362343980, ..., . - Robert G. Wilson v, May 29 2014
The n-th k-gonal number is 1 + k*n(n-1)/2 - (n-1)^2 = A057145(k,n).
For all squares (A001248) of primes p >= 5 at least one a(n) exists with p^2 = a(n) + 1. Thus the subset P_s(3) of rank 3 only is sufficient. Proof: For p >= 5, p^2 == 1 (mod {3,4,6,8,12,24}) and also P_s(3) + 1 = 3*s - 2 == 1 (mod 3). Thus the set {p^2} is a subset of {P_s(3) + 1}; Q.E.D. - Ralf Steiner, Jul 15 2018
For all primes p > 5, at least one polygonal number exists with P_s(k) + 1 = p when k = 3 or 4, dependent on p mod 6. - Ralf Steiner, Jul 16 2018
Numbers m such that r = (2*m/d - 2)/(d - 1) is an integer for some d, where 2 < d < m is a divisor of 2*m. If r is an integer, then m is the d-th (r+2)-gonal number. - Jianing Song, Mar 14 2021

References

  • Albert H. Beiler, Recreations In The Theory Of Numbers, The Queen Of Mathematics Entertains, Dover, NY, 1964, pp. 185-199.

Crossrefs

Cf. A057145, A001248, A177028 (A342772, A342805), A177201, A316676, A364693 (characteristic function).
Complement is A090467.
Sequence A090428 (excluding 1) is a subsequence of this sequence. - T. D. Noe, Jun 14 2012
Other subsequences: A324972 (squarefree terms), A324973, A342806, A364694.
Cf. also A275340.

Programs

  • Maple
    isA090466 := proc(n)
        local nsearch,ksearch;
        for nsearch from 3 do
            if A057145(nsearch,3) > n then
                return false;
            end if;
            for ksearch from 3 do
                if A057145(nsearch,ksearch) = n then
                    return true;
                elif A057145(nsearch,ksearch) > n then
                    break;
                end if;
            end do:
        end do:
    end proc:
    for n from 1 to 1000 do
        if isA090466(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Jul 28 2016
  • Mathematica
    Take[Union[Flatten[Table[1+k*n (n-1)/2-(n-1)^2,{n,3,100},{k,3,40}]]],67] (* corrected by Ant King, Sep 19 2011 *)
    mx = 150; n = k = 3; lst = {}; While[n < Floor[mx/3]+2, a = PolygonalNumber[n, k]; If[a < mx+1, AppendTo[ lst, a], (n++; k = 2)]; k++]; lst = Union@ lst (* Robert G. Wilson v, May 29 2014 and updated Jul 23 2018; PolygonalNumber requires version 10.4 or higher *)
  • PARI
    list(lim)=my(v=List()); lim\=1; for(n=3,sqrtint(8*lim+1)\2, for(k=3,2*(lim-2*n+n^2)\n\(n-1), listput(v, 1+k*n*(n-1)/2-(n-1)^2))); Set(v); \\ Charles R Greathouse IV, Jan 19 2017
    
  • PARI
    is(n)=for(s=3,n\3+1,ispolygonal(n,s)&&return(s)); \\ M. F. Hasler, Jan 19 2017
    
  • PARI
    isA090466(m) = my(v=divisors(2*m)); for(i=3, #v, my(d=v[i]); if(d==m, return(0)); if((2*m/d - 2)%(d - 1)==0, return(1))); 0 \\ Jianing Song, Mar 14 2021

Formula

Integer k is in this sequence iff A176774(k) < k. - Max Alekseyev, Apr 24 2018

Extensions

Verified by Don Reble, Mar 12 2006

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

A342772 Row sums of triangle A177028.

Original entry on oeis.org

3, 4, 5, 9, 7, 8, 13, 13, 11, 17, 13, 14, 24, 20, 17, 25, 19, 20, 32, 27, 23, 33, 29, 26, 37, 37, 29, 41, 31, 32, 45, 41, 40, 56, 37, 38, 53, 48, 41, 57, 43, 44, 70, 55, 47, 65, 53, 50, 74, 62, 53, 73, 65, 56, 77, 69, 59, 81, 61, 62, 85, 80, 73, 98, 67, 68, 93, 88, 71, 97
Offset: 3

Views

Author

Michel Marcus, Mar 21 2021

Keywords

Examples

			6 is a triangular and hexagonal number, so a(6) = 3 + 6 = 9.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(k=3, n, if (ispolygonal(n, k), k));

Formula

a(n) >= n.
For m in A090466, a(m) > m.
For m in A090467, a(m) = m.

A342805 a(n) = (1/n)*(product of the terms of the n-th row of A177028).

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 4, 3, 1, 5, 1, 1, 18, 4, 1, 7, 1, 1, 24, 5, 1, 9, 4, 1, 10, 18, 1, 11, 1, 1, 12, 7, 5, 156, 1, 1, 14, 8, 1, 15, 1, 1, 288, 9, 1, 17, 4, 1, 90, 10, 1, 19, 21, 1, 20, 11, 1, 21, 1, 1, 22, 48, 8, 414, 1, 1, 24, 65, 1, 25, 1, 1, 234, 14, 1, 81, 1, 1, 784, 15
Offset: 3

Views

Author

Michel Marcus, Mar 22 2021

Keywords

Examples

			For n=3, A177028 row is (3), so a(3) = 3/3 = 1.
For n=6, A177028 row is (6, 3), so a(6) = 6*3/6 = 3.
For n=15, A177028 row is (15, 6, 3), so a(15) = 15*6*3/15 = 18.
		

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))); Vec(v); \\ A177028
    a(n) = vecprod(row(n))/n;

Formula

For m in A090466, a(m) > 1.
For m in A090467, a(m) = 1.

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;

A344083 a(n) = f(x)+f(y)+f(z), where (x,y,h) is the n-th Pythagorean triple listed in (A046083, A046084, A009000), and f(m)=A176775(m) is the index of m as k-gonal number for the smallest possible k.

Original entry on oeis.org

6, 9, 7, 11, 9, 9, 12, 10, 9, 10, 9, 11, 18, 10, 16, 9, 9, 20, 9, 7, 18, 9, 18, 15, 11, 14, 7, 12, 10, 13, 12, 7, 12, 15, 12, 17, 14, 18, 13, 9, 13, 14, 15, 10, 9, 7, 9, 21, 12, 10, 15, 23, 7, 9, 12, 20, 9, 18, 17, 28, 14, 16, 7, 21, 18, 24, 21, 21, 20, 16, 25
Offset: 1

Views

Author

Michel Marcus, May 09 2021

Keywords

Comments

6 is the minimum possible value, and A176775(3,4,5) gives this minimum.
Conjecture: there are no other Pythagorean triples that give this minimum. In other words, it is the only triple with 3 A090467 terms.

Crossrefs

Programs

  • PARI
    tp(n) = my(k=3); while( !ispolygonal(n,k), k++); k; \\ A176774
    itp(n) = my(m=tp(n)); (m-4+sqrtint((m-4)^2+8*(m-2)*n)) / (2*m-4); \\ A176775
    f(v) = vecsum(apply(itp, v));
    list(lim) = {my(v=List(), m2, s2, h2, h); for(middle=4, lim-1, m2=middle^2; for(small=1, middle, s2=small^2; if(issquare(h2=m2+s2, &h), if(h>lim, break); listput(v, [h, middle, small]);););); v = vecsort(Vec(v)); apply(f, v);}
Showing 1-8 of 8 results.