Hex Number

DOWNLOAD Mathematica Notebook HexNumber

A hex number, also called a centered hexagonal number, is given by

H_n=1+6T_n
(1)
=3n^2+3n+1,
(2)

where T_n=n(n+1)/2 is the nth triangular number and the indexing with H_0=1 is used following Conway and Guy (1996). The first few hex numbers for n=0, 1, ... are 1, 7, 19, 37, 61, 91, 127, 169, ... (OEIS A003215).

The hex numbers satisfy the recurrence equation

 H_n=2H_(n-1)-H_(n-2)+6.
(3)

The generating function of the hex numbers is

 ((x^2+4x+1))/((1-x)^3)=1+7x+19x^2+37x^3+....
(4)

The hex numbers are related to the cubic numbers by

 sum_(k=0)^nH_k=(n+1)^3.
(5)

This follows immediately from the fact that H_n=(n+1)^3-n^3, giving a telescoping sum.

The first triangular hex numbers are 1, 91, 8911, 873181, 85562821, ... (OEIS A006244). These correspond to indices (m,n) of triangular and hex numbers (T_m,H_n) of m=0, 5, 54, 539, 5340, 52865, 523314, 5180279, 51279480, ... (OEIS A087125) and n=1, 13, 133, 1321, 13081, 129493, 1281853, ... (OEIS A031138). These are given by solving the Diophantine equation

 1/2m(m+1)=3n^2+3n+1.
(6)

The first few square hex numbers are 1, 169, 32761, 6355441, ... (OEIS A006051). These correspond to indices (m,n) of triangular and hex numbers (S_m,H_n) of m=0, 7, 104, 1455, 20272, 282359, 3932760, ... (OEIS A001921) and n=1, 13, 181, 2521, 35113, 489061, 6811741, ... (OEIS A001570). These are given by solving the Diophantine equation

 n^2=3m^2+3m+1.
(7)

The only hex number that is both square and triangular is 1.

There are no cubic hex numbers.

The prime hex numbers are sometimes known as Cuban primes.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.