A hexagonal square number is both a hexagonal number and a square
number
for positive integers
and
. Its indices satisfy
, or
|
(1)
|
Completing the square and rearranging gives
|
(2)
|
Therefore, defining and
gives the Pell equation
|
(3)
|
The first few solutions are , (17, 12), (99, 70), (577, 408), .... These give
the solutions
,
(9/2, 6), (25, 35), (289/2, 204), ..., giving the positive
integer solutions (1, 1), (25, 35), (841, 1189), (28561, 40391), ... (OEIS A008844 and A046176).
The corresponding hexagonal square numbers are 1, 1225, 1413721, 1631432881, 1882672131025,
... (OEIS A046177).
Closed-form solutions for integers are
|
(4)
| |||
|
(5)
|
giving the th
hexagonal square number as
|
(6)
|
A recurrence relation for is given by
|
(7)
|
for integer , with
. The square root
in the closed-form solution indexed from
is
(M. Carreira, pers. comm., Sep. 11, 2004).