An octagonal heptagonal number is a number which is simultaneously octagonal and heptagonal. Let denote the
th octagonal number and
the
th
heptagonal number, for positive
integers
and
.
A number which is both octagonal and heptagonal
satisfies the equation
, or
|
(1)
|
Completing the square and rearranging gives
|
(2)
|
This gives the second-order Diophantine equation
|
(3)
|
where
and
.
The first few positive integer solutions are
,
(7, 4), (73, 40), (157, 86), .... Selecting the pairs that give positive
integer indices yields
, (345, 315), (166145, 151669), ... (OEIS A048904
and A048905), corresponding to the octagonal
heptagonal numbers 1, 297045, 69010153345, ... (OEIS A048906).