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.

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

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

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
    

A343981 a(n) is the least integer h such that there exists a Pythagorean triple whose hypotenuse is h and whose other legs z satisfy A176774(z) = n.

Original entry on oeis.org

35, 0, 13, 0, 2727, 104, 13911, 17370, 426996, 1855, 340119, 89375, 3588, 37400, 3034, 57709, 2103750, 88400, 53290, 506817, 15263560, 141921, 660350, 3372270, 419356, 40716, 57526469, 356025, 639135, 5316785, 872934, 1493219, 11939849, 119616, 331290, 3008185
Offset: 3

Views

Author

Michel Marcus, May 06 2021

Keywords

Comments

a(4)=0 is conjectured.
a(6)=0 because all hexagonal numbers are triangular numbers (see A176948).

Examples

			a(3)=35 because of [21, 28, 35] where A176774(21) = A176774(35) = 3.
a(5)=13 because of [5, 12, 13] where A176774(5) = A176774(12) = 5.
a(7)=2727 because of [540, 2673, 2727] where A176774(540) = A176774(2673) = 7.
		

Crossrefs

Programs

  • PARI
    p(s, n) = ((s-2)*n^2 - (s-4)*n)/2;
    lista(nn, n) = {my(v = vector(nn, k, p(n, k))); v = select(x->(tp(x)==n), v); my(kh = oo, kv = oo); for (i=1, #v, for (j=1, i, my(h2 = v[i]^2 + v[j]^2, h); if (issquare(h2, &h), if (h < kh, kh = h; kv = [v[j], v[i], kh]);););); kh;}
    a(n) = {if (n==4, return (0)); if (n==6, return (0)); my(nn = 2); while ((res=lista(nn, n)) == oo, nn *= 2); res;}

A373921 The last entry in the difference table for {the n-th row of A177028 arranged in increasing order}.

Original entry on oeis.org

3, 4, 5, 3, 7, 8, 5, 7, 11, 7, 13, 14, 6, 12, 17, 11, 19, 20, 8, 17, 23, 15, 21, 26, 17, 19, 29, 19, 31, 32, 21, 27, 30, 6, 37, 38, 25, 32, 41, 27, 43, 44, 12, 37, 47, 31, 45, 50, 20, 42, 53, 35, 44, 56, 37, 47, 59, 39, 61, 62, 41, 44, 57, 12, 67, 68, 45, 49, 71, 47, 73, 74, 32
Offset: 3

Views

Author

Robert G. Wilson v, Jun 22 2024

Keywords

Comments

Inspired by A342772 and A187202.
The n-th row of A177028 are all integers k for which n is a k-gonal number.
As an example: row 10 of A177028 contain 3 and 10, because 10 is a 10-gonal number but also a triangular number.
-3n/2 < a(n) <= n.
a(n) = n if n is an odd prime (A065091), an odd composite number in A274967, or even numbers in A274968.
a(n) = 0: 231, tested up to 150000.
a(n) < 0: 441, 540, 561, 1089, 1128, 1296, 1521, 1701, 1716, 1881, 2016, 2211, 2541, 2556, 2601, ..., .
a(n) is negative less than 1% of the time.

Examples

			a(15) = 6, because the 15th row of A177028 is {3,6,15} -> {3,9} -> {6};
a(36) = 6, because the 36th row of A177028 is {3,4,13,36} -{1,9,23} - {8,14} -> {6};
a(225) = 37, because the 225th row of A177028 is {4,8,24,76,225} -> {4,16,52,149} -> {12,36,97} -> {24,61} -> {37};
a(561) = -82, because the 561st row of A177028 is {3,6,12,39,188,561} -> {3,6,27,149,373} -> {3,21,122,224} -> {18,101,102}, {83,1} -> {-82}; etc.
		

Crossrefs

Programs

  • Mathematica
    planeFigurateQ[n_, r_] := IntegerQ[((r -4) + Sqrt[(r -4)^2 + 8n (r -2)])/(2 (r -2))]; a[n_] := Block[{pg = Select[ Range[3, n], planeFigurateQ[n, #] &]}, Differences[pg, Length@ pg - 1][[1]]]; Array[a, 73, 3]
Showing 1-8 of 8 results.