A nonagonal number (or an enneagonal number) is a figurate number that extends the concept of triangular and square numbers to the nonagon (a nine-sided polygon). However, unlike the triangular and square numbers, the patterns involved in the construction of nonagonal numbers are not rotationally symmetrical. Specifically, the nth nonagonal number counts the number of dots in a pattern of n nested nonagons, all sharing a common corner, where the ith nonagon in the pattern has sides made of i dots spaced one unit apart from each other. The nonagonal number for n is given by the formula:
The first few nonagonal numbers are:
The parity of nonagonal numbers follows the pattern odd-odd-even-even.
Letting denote the nth nonagonal number, and using the formula for the nth triangular number,
If x is an integer, then n is the x-th nonagonal number. If x is not an integer, then n is not nonagonal.