polygonalnumber
A polygonal number is a number that can be arranged in a regular polygon with a constant number of dots on each side. The nth s-gonal number, where s is the number of sides and n is a positive integer, counts the dots needed to form a regular s-gon with n dots on each side.
The nth s-gonal number is given by the formula P(s,n) = ((s-2)n^2 - (s-4)n)/2. An equivalent form is
Common examples include triangular numbers (s = 3): P(3,n) = n(n+1)/2; square numbers (s = 4): P(4,n) = n^2; pentagonal
A key property is the first difference between consecutive polygonal numbers: P(s,n+1) − P(s,n) = (s-2)n + 1. This
Historically, polygonal numbers appear in ancient and later mathematical writings, and they feature in the broader