OFFSET
3,1
COMMENTS
See A188893 and A188894 for the corresponding indices of these terms. Note that a(n) is zero for n = 11, 18, 38 (numbers in A188892). Although the Mathematica program searches only the first 20000 triangular numbers for n-gonal numbers, the Reduce function can show that there are no triangular n-gonal numbers (other than 0 and 1) for these n.
LINKS
Eric W. Weisstein, MathWorld: Polygonal Number
Eric W. Weisstein, MathWorld: Triangular Number
MATHEMATICA
NgonIndex[n_, v_] := (-4 + n + Sqrt[16 - 8*n + n^2 - 16*v + 8*n*v])/(n - 2)/2; Table[k = 2; While[tr = k*(k+1)/2; i = NgonIndex[n, tr]; k < 20000 && ! IntegerQ[i], k++]; If[k==20000, tr=0]; tr, {n, 3, 50}]
Table[SelectFirst[PolygonalNumber[n, Range[2, 1000]], OddQ[Sqrt[8#+1]]&], {n, 3, 100}]/.Missing["NotFound"]->0 (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 10 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Apr 13 2011
STATUS
approved