Polygonal Number

Author

Eric W. Weisstein
May 30, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/PolygonalNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PolygonalNumber.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Figure

Show[GraphicsArray[Table[Graphics[PolygonalDiagram[n,k],AspectRatio->Automatic,PlotRange->All],{n,3,5},{k,0,4}]],ImageSize->500]

Check

Table[Polygonal[r,#]&/@Range[10],{r,3,6}]//ColumnForm

(#/@Range[10])&/@{TriangularNumber,SquareNumber,PentagonalNumber,HexagonalNumber}

Generating Functions

a=FullSimplify[PowerSum[#[n],{x,n}]]&/@{TriangularNumber,SquareNumber,PentagonalNumber,HexagonalNumber,HeptagonalNumber,OctagonalNumber,NonagonalNumber}

b=Table[x(1+(n-3)x)/(1-x)^3,{n,3,9}]

Simplify[a-b]

Highly Polygonal

MaxIndex[r_,max_]:=Module[{n},Floor[Last@Reduce[Polygonal[r,n]==max&&n>0,n]]
]

{t=Table[Polygonal[r,#]&/@Range[MaxIndex[r,10^12]],{r,3,16}];//Timing,
s=Split[Sort[Flatten[t]]];//Timing}

Length/@t

poly2=Take[First/@Select[s,Length[#]>1&],110]

poly3=First/@Select[s,Length[#]>2&]

{#,{2,0}+#&/@Position[t,#]}&/@poly3//ColumnForm

poly4=First/@Select[s,Length[#]>3&]