OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..2000
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
EXAMPLE
For n = 1, p = 5, x=9, y=4 since 9^2 = 5*4^2 + 1, so a(1) = 9.
MATHEMATICA
PellSolve[(m_Integer)?Positive] := Module[{cof, n, s}, cof = ContinuedFraction[Sqrt[m]]; n = Length[Last[cof]]; If[ OddQ[n], n = 2*n]; s = FromContinuedFraction[ContinuedFraction[Sqrt[m], n]]; {Numerator[s], Denominator[s]}]; First /@ PellSolve /@ Select[Prime@Range@54, Mod[ #, 4] == 1 &] (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
N. J. A. Sloane, Apr 18, 2003
EXTENSIONS
More terms from Robert G. Wilson v, Feb 28 2006
STATUS
approved