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.

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

A274967 Odd composite numbers n which are not m-gonal number for 3 <= m < n.

Original entry on oeis.org

77, 119, 143, 161, 187, 203, 209, 221, 299, 319, 323, 329, 371, 377, 391, 407, 413, 437, 473, 493, 497, 517, 527, 533, 539, 551, 581, 583, 589, 611, 623, 629, 649, 667, 689, 707, 713, 731, 737, 749, 767, 779, 791, 799, 803, 817, 851, 869, 893, 899, 901, 913
Offset: 1

Views

Author

Daniel Forgues, Jul 12 2016

Keywords

Comments

An m-gonal number, m >= 3, i.e. of form n = (k/2)*[(m-2)*k - (m-4)], yields a nontrivial factorization of n if and only if of order k >= 3.
Odd composite numbers n for which A176948(n) = n.
All odd composite n are coprime to 30 (see next comment) and have smallest prime factor >= 7, e.g.
77 = 7*11, 119 = 7*17, 143 = 11*13, 161 = 7*23,
187 = 11*17, 203 = 7*29, 209 = 11*19, 221 = 13*17,
299 = 13*23, 319 = 11*29, 323 = 17*19, 329 = 7*47,
371 = 7*53, 377 = 13*29, 391 = 17*23, 407 = 11*37,
413 = 7*59, 437 = 19*23, 473 = 11*43, 493 = 17*29,
497 = 7*71, 517 = 11*47, 527 = 17*31, 533 = 13*41,
539 = 7*7*11, 551 = 19*29, 581 = 7*83, 583 = 11*53,
589 = 19*31, 611 = 13*47, 623 = 7*89, 629 = 17*37,
649 = 11*59, 667 = 23*29, 689 = 13*53, 707 = 7*101,
713 = 23*31, 731 = 17*43, 737 = 11*67, 749 = 7*107,
767 = 13*59, 779 = 19*41, 791 = 7*113, 799 = 17*47,
803 = 11*73, 817 = 19*43, 851 = 23*37, 869 = 11*79,
893 = 19*47, 899 = 29*31, 901 = 17*53, 913 = 11*83.
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 a(n) are coprime to 5.
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 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 k = 3, thus m <= (n+3)/3.

Examples

			77 is in this sequence because 77 is trivially a 77-gonal number of order k = 2, but not an m-gonal number for 3 <= k <= (1/2)*{-1 + sqrt[1 + 8*77]}.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500]2+1, ! PrimeQ[#] && FindInstance[n*(4 + n*(s-2)-s)/2 == # && s >= 3 && n >= 3, {s, n}, Integers] == {} &] (* Giovanni Resta, Jul 13 2016 *)
  • Python
    from sympy import isprime
    A274967_list = []
    for n in range(3,10**6,2):
        if not isprime(n):
            k = 3
            while k*(k+1) <= 2*n:
                if not (2*(k*(k-2)+n)) % (k*(k - 1)):
                    break
                k += 1
            else:
                A274967_list.append(n) # Chai Wah Wu, Jul 28 2016
  • Sage
    def is_a(n):
        if is_even(n): return False
        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..913) if is_a(n)]) # Peter Luschny, Jul 28 2016
    

Extensions

a(10)-a(52) from Giovanni Resta, Jul 13 2016

A274968 Even numbers n >= 4 which are not m-gonal number for 3 <= m < n.

Original entry on oeis.org

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

Views

Author

Daniel Forgues, Jul 12 2016

Keywords

Comments

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 of order k >= 3.
Except for a(1) = 4, all a(n) are congruent to 2 (mod 6), although from 8 to 302, the numbers
92: 5-gonal of order 8,
176: 5-gonal of order 11, 8-gonal of order 8,
260: 11-gonal of order 8,
are not in this sequence.
Even numbers n for which A176948(n) = n.
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 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.
a(1) = 4 is the only square number: 4-gonal with order k = 2.
All integers of the form n = 6j + 4, with j >= 1, are m-gonal numbers of order k = 4, with m = j + 2, which means that none are in this sequence. - Daniel Forgues, Aug 01 2016

Examples

			20 is in this sequence because 20 is trivially a 20-gonal number of order k = 2 (element of A051872) but not an m-gonal number for 3 <= k <= (1/2)*{-1 + sqrt[1 + 8*20]}.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {forstep(n=4, nn, 2, sp = n; forstep(k=n, 3, -1, if (ispolygonal(n, k), sp=k);); if (sp == n, print1(n, ", ")););} \\ Michel Marcus, Sep 06 2016
  • Python
    A274968_list = []
    for n in range(4,10**6,2):
        k = 3
        while k*(k+1) <= 2*n:
            if not (2*(k*(k-2)+n)) % (k*(k - 1)):
                break
            k += 1
        else:
            A274968_list.append(n) # Chai Wah Wu, Jul 28 2016
    
  • Sage
    def is_A274968(n):
        if is_odd(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_A274968(n)]) # Peter Luschny, Jul 28 2016
    
Showing 1-4 of 4 results.