999
Let the first two terms of the sequence be
and
respectively. Then
the next three terms are
,
and
. So
. For
to be as large as possible, we need
to be as small as possible,
consistent with their both being positive integers. If
then
,
but
is an integer, so
.
However, if
then
, so the maximum possible value of
is
.