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.

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