If it’s not beautiful,
it’s not mathematics:)
E542 On the remarkable properties of the pentagonal numbers.
https://scholarlycommons.pacific.edu/euler-works/542/
​
E541 Euler proofs the pentagonal number theorem,
and recalls its application to the partition of numbers.
https://scholarlycommons.pacific.edu/euler-works/541/
The main goal is to introduce Centered Hexagonal Numbers together with a graphical representation using Triangular Numbers and Centered Triangular Numbers. The secondary goal is to introduce Pentagonal Numbers together with a graphical representation using only Triangular Numbers.
https://oeis.org/A000217​
​Triangular Numbers:
a(n)=binomial(n+1,2)=n(n+1)/2=PolygonalNumber(3,n)
​
​https://oeis.org/A005448​
​Centered Triangular Numbers:
a(n)=3n(n-1)/2+1
.
https://oeis.org/A003215
​Centered Hexagonal Numbers:
3n(n+1)+1
(starting with index 0)

​
3n(n-1)+1
(starting with index 1)
Definition Triangular Number,
T
n
:
In[]:=
TriangularNumber[n_]:=n(n+1)/2
First ten Triangular Numbers:
In[]:=
TriangularNumber/@Range[10]
Out[]=
{1,3,6,10,15,21,28,36,45,55}
Mathematica knows the TriangularNumber[n] as PolygonalNumber[3,n]:
In[]:=
Reduce[PolygonalNumber[3,n]==TriangularNumber[n]]
Out[]=
True
And this is why a triangular number gets its name:
In[]:=
TriangularNumberGraphics[5]
Out[]=
Definition Centered Hexagonal Number,
CH
n
:
In[]:=
CenteredHexagonalNumber[n_]:=3n(n-1)+1
Remark:
3n(n+1)+1
is the same sequence with a shifted index.
In[]:=
{Map[3#(#+1)+1&,Range[0,9]],Map[3#(#-1)+1&,Range[10]]}
Out[]=
{{1,7,19,37,61,91,127,169,217,271},{1,7,19,37,61,91,127,169,217,271}}
First ten Centered Hexagonal Numbers:
In[]:=
CenteredHexagonalNumber/@Range[10]
Out[]=
{1,7,19,37,61,91,127,169,217,271}
Definition Centered Triangular Number,
CT
n
:
In[]:=
CenteredTriangularNumber[n_]:=
3n(n-1)
2
+1
First ten Centered Triangular Numbers :
In[]:=
CenteredTriangularNumber/@Range[10]
Out[]=
{1,4,10,19,31,46,64,85,109,136}
Three consecutive triangular number make a centered triangular number:
In[]:=
RepresentCenteredTriangularNumber[4]
Out[]=
19=10+6+3
And this is what it looks like:
In[]:=
CenteredTriangularNumberGraphics[4]
Out[]=
CT
n
is the sum of three consecutive triangular numbers:
CT
n
=
T
n
+
T
n-1
+
T
n-2
In[]:=
Reduce[TriangularNumber[n-2]+TriangularNumber[n-1]+TriangularNumber[n]==CenteredTriangularNumber[n]]
Out[]=
True
CH
n
is the sum of three Triangular Numbers minus 3 plus a centered triangular number:
CH
n
=3(
T
n
-1)+
CT
n-1
=
T
n
+(
T
n
-1)+(
T
n
-2)+
CT
n-1
In[]:=
Reduce[CenteredHexagonalNumber[n]==CenteredTriangularNumber[n-1]+3TriangularNumber[n]-3]
Out[]=
True
Graphical representation for
CH
n
:
​
T
n
-2
is blue,
T
n
-1
is black,
T
n
is red, and
CT
n-1
is green.
Example:
CH
5
=(
T
5
-2)+(
T
5
-1)+
T
5
+
CT
4
:
In[]:=
RepresentCenteredHexagonalNumber[5]
Out[]=
61=13+14+15+19
In[]:=
CenteredHexagonalNumberGraphics[5]
Out[]=

Secondary goal: Pentagonal Numbers

https://oeis.org/A000326
Pentagonal numbers:
a(n)=n(3n-1)/2
.
Definition Pentagonal Number
P
n
In[]:=
PolygonalNumber[5,n]
Out[]=
1
2
n(-1+3n)
In[]:=
PentagonalNumber[n_]:=n(3n-1)/2
The first ten Pentagonal Numbers:
In[]:=
Map[PentagonalNumber,Range[10]]
Out[]=
{1,5,12,22,35,51,70,92,117,145}
The Pentagonal Numbers can be expressed by Triangular Numbers alone:
​
P
n
=
T
n-2
+
T
n
-1+
T
n
=
T
n-2
+2
T
n
-1
In[]:=
Reduce[PentagonalNumber[n]==(TriangularNumber[n-2]+2TriangularNumber[n]-1)]
Out[]=
True
In[]:=
RepresentPentagonalNumber[10]
Out[]=
145=54+55+36
A graphical representation of a pentagonal number:
In[]:=
PentagonalNumberGraphics[8]
Out[]=

Side trip into art

This is minimal art of a pentagonal number:
A centered hexagonal number with symmetric coloring as minimal art:

Euler’s pentagonal number theorem

Euler is the master of us all.
Pierre-Simon Laplace.
https://en.wikipedia.org/wiki/Pentagonal_number_theorem​
​https://en.wikipedia.org/wiki/Euler_function
Euler’s pentagonal number theorem is the transformation of a given infinite product into an infinite series:
Using pentagonal numbers explicitly:
This function is called Euler function (and QPochhammer[x,x] in Mathematica):
According to https://en.wikipedia.org/wiki/Euler_function, there are some remarkable identities from Ramanujan’s lost Notebook, here is the first:
According to https://en.wikipedia.org/wiki/Euler_function,
“Using the Pentagonal number theorem, exchanging sum and integral, and then invoking complex-analytic methods, one derives.”:

CITE THIS NOTEBOOK

Centered Hexagonal, Centered Triangular, Triangular and Pentagonal Numbers​
by Oliver Seipel​
Wolfram Community, STAFF PICKS, October 11, 2023
​https://community.wolfram.com/groups/-/m/t/3032508