Higher dimensional polygonal numbers formula

48 Views Asked by At

The general formula for the $m$-th $n$-gonal number is given by $$P_n(m) = \frac{m^2(n-2)-m(n-4)}{2}$$

So, to give quick examples:

Triangular numbers ($n=3$): $$P_3(m) = \frac{m^2+m}{2}$$

Square numbers ($n=4$): $$P_4(m) = m^2$$

Pentagonal numbers ($n=5$): $$P_5(m) = \frac{3m^2-m}{2}$$

And so on...

Wikipedia mentions here a generalization to higher dimensions when considering the dots as $r$-dimensional balls. $r=2$ would give us polygonal numbers, $r=3$ would give us polyhedral numbers, etc. Let's denote this as $P^r_n(m)$, my question is whether there is a general formula for $P^r_n(m)$. It seems that many different sources use different terminology that sometimes contradicts one another, so I haven't been able to find any such formula. Any help is appreciated!