Is there an efficient, general formula to verify if a number is a n-sided polygonal number?

83 Views Asked by At

I've seen formulas to verify if a number is a triangular number, a pentagonal number, or a hexagonal number, but I haven't seen a general formula for verifying if a number is an n-sided polygonal number. Does such a formula exist?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes. The polygon number formula for the $n$th $r$-gonal number is $$\frac{n((r-2)n-(r-4))}{2}$$

Wolfram Mathworld has an article about it here.