

A176774


Smallest polygonality of n = smallest integer m>=3 such that n is mgonal number.


10



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

3,1


COMMENTS

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


LINKS

Michel Marcus, Table of n, a(n) for n = 3..10000
Eric W. Weisstein, Polygonal Number. MathWorld.


EXAMPLE

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


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}] (* JeanFrançois Alcover, Sep 04 2016 *)


PROG

(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*(k2)+n), k*(k1))
if not b:
return a
k = 1 # Chai Wah Wu, Jul 28 2016


CROSSREFS

Cf. A090466, A090467.
Sequence in context: A123901 A214682 A093395 * A126352 A094758 A283971
Adjacent sequences: A176771 A176772 A176773 * A176775 A176776 A176777


KEYWORD

nonn


AUTHOR

Max Alekseyev, Apr 25 2010


STATUS

approved



