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.

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);}

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

A177025 Number of ways to represent n as a polygonal number.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, May 01 2010

Keywords

Comments

Frequency of n in the array A139601 or A086270 of polygonal numbers.
Since n is always n-gonal number, a(n) >= 1.
Conjecture: Every positive integer appears in the sequence.
Records of 2, 3, 4, 5, ... are reached at n = 6, 15, 36, 225, 561, 1225, ... see A063778. [R. J. Mathar, Aug 15 2010]

References

  • J. J. Tattersall, Elementary Number Theory in Nine chapters, 2nd ed (2005), Cambridge Univ. Press, page 22 Problem 26, citing Wertheim (1897)

Crossrefs

Programs

  • Maple
    A177025 := proc(p)
        local ii,a,n,s,m ;
        ii := 2*p ;
        a := 0 ;
        for n in numtheory[divisors](ii) do
            if n > 2 then
                s := ii/n ;
                if (s-2) mod (n-1) = 0 then
                    a := a+1 ;
                end if;
            end if;
        end do:
        return a;
    end proc: # R. J. Mathar, Jan 10 2013
  • Mathematica
    nn = 100; t = Table[0, {nn}]; Do[k = 2; While[p = k*((n - 2) k - (n - 4))/2; p <= nn, t[[p]]++; k++], {n, 3, nn}]; t (* T. D. Noe, Apr 13 2011 *)
    Table[Length[Intersection[Divisors[2 n - 2] + 1, Divisors[2 n]]] - 1, {n, 3, 100}] (* Jonathan Sondow, May 09 2014 *)
  • PARI
    a(n) = sum(i=3, n, ispolygonal(n, i)); \\ Michel Marcus, Jul 08 2014
    
  • Python
    from sympy import divisors
    def a(n):
        i=2*n
        x=0
        for d in divisors(i):
            if d>2:
                s=i/d
                if (s - 2)%(d - 1)==0: x+=1
        return x # Indranil Ghosh, Apr 28 2017, translated from Maple code by R. J. Mathar

Formula

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

Extensions

Extended by R. J. Mathar, Aug 15 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

A090467 Numbers which are not regular figurative or polygonal numbers of order greater than 2. That is, numbers not of the form 1 + k*m*(m-1)/2 - (m-1)^2 where k > 2 and m > 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 11, 13, 14, 17, 19, 20, 23, 26, 29, 31, 32, 37, 38, 41, 43, 44, 47, 50, 53, 56, 59, 61, 62, 67, 68, 71, 73, 74, 77, 79, 80, 83, 86, 89, 97, 98, 101, 103, 104, 107, 109, 110, 113, 116, 119, 122, 127, 128, 131, 134, 137, 139, 140, 143, 146, 149, 151, 152
Offset: 1

Views

Author

Robert G. Wilson v, Dec 01 2003

Keywords

Comments

The m-th k-gonal number is 1 + k*m*(m-1)/2 - (m-1)^2 = A057145(k,m).
Numbers that are strictly trivially polygonal: numbers m that are only 2-gonal and m-gonal. - Daniel Mondot, Jun 13 2024

Examples

			3 is a triangular number, but is not a k-gonal number for any other k, so 3 is a term.
6 is both a triangular number and a hexagonal number, so 6 is not a term.
		

References

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

Crossrefs

Complement is A090466.

Programs

  • Mathematica
    Complement[ Table[i, {i, 300}], Take[ Union[ Flatten[ Table[1 + k*n(n - 1)/2 - (n - 1)^2, {n, 3, 40}, {k, 3, 300}]]], 300]]
  • PARI
    isok(n) = (n < 3) || (vecsum(vector(n-2, k, k+=2; ispolygonal(n, k))) == 1); \\ Michel Marcus, May 01 2016

Formula

An integer n >= 3 is in this sequence iff A176774(n) = n (or, equivalently, A176775(n) = 2). - Max Alekseyev, Apr 24 2018

Extensions

Verified by Don Reble, Mar 12 2006

A176948 a(n) is the smallest solution x to A176774(x)=n; a(n)=0 if this equation has no solution.

Original entry on oeis.org

3, 4, 5, 0, 7, 8, 24, 27, 11, 33, 13, 14, 42, 88, 17, 165, 19, 20, 60, 63, 23, 69, 72, 26, 255, 160, 29, 87, 31, 32, 315, 99, 102, 208, 37, 38, 114, 805, 41, 123, 43, 44, 132, 268, 47, 696, 475, 50, 150, 304, 53, 159, 162, 56, 168, 340, 59, 177, 61, 62, 615, 1309, 192, 388
Offset: 3

Views

Author

Vladimir Shevelev, Apr 29 2010

Keywords

Comments

A greedy inverse function to A176774.
Conjecture: For every n >= 4, except for n=6, there exists an n-gonal number N which is not k-gonal for 3 <= k < n.
This means that the sequence contains only one 0: a(6)=0. For n=6 it is easy to prove that every hexagonal number (A000384) is also triangular (A000217), i.e., N does not exist. - Vladimir Shevelev, Apr 30 2010

Examples

			For n=9, 24 is a nonagonal number, but not an octagonal number, heptagonal number, hexagonal number, etc. The smaller nonagonal number 9 is also a square number. Thus, a(9) = 24. - _Michael B. Porter_, Jul 16 2016
		

Crossrefs

Programs

  • Maple
    A139601 := proc(k,n) option remember ; n/2*( (k-2)*n-k+4) ; end proc:
    A176774 := proc(n) option remember ; local k,m,pol ; for k from 3 do for m from 0 do pol := A139601(k,m) ; if pol = n then return k ; elif pol > n then break; end if; end do: end do: end proc:
    A176948 := proc(n) if n = 6 then 0; else for x from 3 do if A176774(x)= n then return x ; end if; end do: end if; end proc:
    seq(A176948(n),n=3..80) ; # R. J. Mathar, May 03 2010
  • Mathematica
    A176774[n_] := A176774[n] = (m = 3; While[Reduce[k >= 1 && n == k (k (m - 2) - m + 4)/2, k, Integers] == False, m++]; m); a[6] = 0; a[p_?PrimeQ] := p; a[n_] := (x = 3; While[A176774[x] != n, x++]; x); Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 3, 100}] (* Jean-François Alcover, Sep 04 2016 *)

Formula

a(p) = p if p is any odd prime.

Extensions

More terms from R. J. Mathar, May 03 2010

A176949 Composite numbers n for which A176948(n) = n.

Original entry on oeis.org

4, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, 77, 80, 86, 98, 104, 110, 116, 119, 122, 128, 134, 140, 143, 146, 152, 158, 161, 164, 170, 182, 187, 188, 194, 200, 203, 206, 209, 212, 218, 221, 224, 230, 236, 242, 248, 254, 266, 272, 278, 284, 290, 296, 299, 302
Offset: 1

Views

Author

Vladimir Shevelev, Apr 29 2010, Apr 30 2010

Keywords

Comments

If p >= 3 is prime, then A176948(p) = p. The sequence lists composite numbers with this property.
It is interesting that there is a large overlap with terms in A140164 (but there are exceptions, e.g., 77).
From Daniel Forgues, Jul 15 2016: (Start)
Composite numbers n which are not of form (k/2)*[(m-2)*k - (m-4)] for any m >= 3 and k >= 3, thus not m-gonal numbers for any order k >= 3.
An m-gonal number, m >= 3, i.e., of the form n = (k/2)*[(m-2)*k - (m-4)], yields a nontrivial factorization of n if and only if k >= 3.
Since we are looking for solutions of (m-2)*k^2 - (m-4)*k - 2*n = 0,
with m >= 3 and k >= 3, the largest order k we need to consider is
k = {(m-4) + sqrt[(m-4)^2 + 8*(m-2)*n]}/[2*(m-2)] with m = 3, thus
k <= (1/2)*{-1 + sqrt[1 + 8*n]}.
Or, since we are looking for solutions of 2n = m*k*(k-1) - 2*k*(k-2),
with m >= 3 and k >= 3, the largest m we need to consider is
m = [2n + 2*k*(k-2)]/[k*(k-1)] with order k = 3, thus m <= (n+3)/3.
Composite numbers n which are divisible by 3 are m-gonal numbers of order 3, with m = (n + 3)/3. Thus all a(n) are coprime to 3.
Odd composite numbers n which are divisible by 5 are m-gonal numbers of order 5, with m = (n + 15)/10. Thus all odd a(n) are coprime to 5.
a(1) = 4 is the only square number: 4-gonal with order k = 2. (End)
An integer n which is congruent to k (mod t_{k-1}) with 3 <= t_{k-1} < n, i.e. n = j * t_{k-1} + k with k >= 3 and j >= 1, is an m-gonal number of order k, with m = j + 2, where t_{k-1} is a triangular number. If all the congruence tests fail, a composite n belongs to this sequence. - Daniel Forgues, Aug 02 2016
From Jonathan Dushoff, Apr 05 2022: (Start)
All numbers n>2 are trivially n-gonal numbers, and will thus have A176948(n)=n unless they have a nontrivial polygonal decomposition. Thus this is just the sequence of non-polygonal composite numbers.
Note that the 2nd through 13th terms are in arithmetic progression.
Some reasons: many of the smaller odd numbers are prime (and thus don't appear); numbers of the form 6x (or 6x+3) are always order-3 numbers; numbers of the form 6x+4 are always order-4 numbers; small odd composites not divisible by 3 are usually divisible by 5, and are thus order-5 numbers.
In fact, the first number to break the arithmetic progression is the first product of distinct primes > 5.
Conversely, 6x+2 numbers cannot be order-3 or -6 numbers (those are divisible by 3); order-4 numbers (all == 4 (mod 6)); order-5 numbers (all odd); or order-7 numbers (all == 1 (mod 3)).
The first 6x+2 composite not in the list is order-8 pentagonal number 92. (End)

Examples

			8 is in the sequence since it is composite and is an octagonal number, but not a heptagonal number, hexagonal number, pentagonal number, etc. 10 is not in the sequence because even though it is composite and a decagonal number, it is also a triangular number: 10 = 1 + 2 + 3 + 4. - _Michael B. Porter_, Jul 16 2016
		

Crossrefs

Programs

  • Mathematica
    Select[Range[302], CompositeQ@ # && FindInstance[n*(4 + n*(s-2) - s)/2 == # && s >= 3 && n >= 3, {s, n}, Integers] == {} &] (* Giovanni Resta, Jul 13 2016 *)
  • PARI
    listc(nn) = {forcomposite(c=1, nn, sp = c; forstep(k=c, 3, -1, if (ispolygonal(c, k), sp=k);); if (sp == c, print1(c, ", ")););} \\ Michel Marcus, Sep 06 2016
  • Sage
    def is_a(n):
        if is_prime(n): return False
        for m in (3..(n+3)//3):
            if pari('ispolygonal')(n, m):
                return False
        return True
    print([n for n in (3..302) if is_a(n)]) # Peter Luschny, Jul 28 2016
    

Extensions

Offset corrected and sequence extended by R. J. Mathar, May 03 2010
Showing 1-8 of 8 results.