# PolygonalNumber

gives the n triangular number .

PolygonalNumber[r,n]

gives the n r-gonal number .

# Details • Mathematical function, suitable for both symbolic and numerical manipulation.
• is generically defined as .
• PolygonalNumber[r,n] is generically defined as .
• PolygonalNumber[r,n] can be interpreted as the number of points arranged in the form of n-1 polygons of r sides. For instance for r=3 and n=4:
• • PolygonalNumber automatically threads over lists.

# Examples

open allclose all

## Basic Examples(2)

Return the first 10 triangular numbers:

Return the tenth r-gonal number of several regular polygons:

## Scope(4)

Use PolygonalNumber with integer arguments:

Use RegularPolygon to specify the number of sides of a regular polygon:

Use PolygonalNumber with symbolic input:

## Applications(2)

Generate random octagonal numbers:

Plot the first 50 triangular, square, and pentagonal numbers:

## Properties & Relations(9)

The 0 polygonal number of any regular polygon is zero:

The first polygonal number of any regular polygon is one:

Every other triangular number is a hexagonal number:

The sum of two consecutive triangular numbers is a square number:

Every pentagonal number is one third of a triangular number:

The difference between the n r-gonal number and the n (r+1)-gonal number is the (n-1) triangular number:

Even perfect numbers are triangular numbers related to Mersenne prime exponents:

Even perfect numbers are hexagonal numbers related to Mersenne prime exponents:

All even perfect numbers greater than 6 are of the following form for some value of k:

## Neat Examples(1)

Visualize polygonal numbers: