OFFSET
1,6
COMMENTS
When n is a square, the trivial solution (x,y) = (1,0) is taken; otherwise we take the least nontrivial solution that satisfies one of the four equations with +1, -1, +4 or -4. - Ray Chandler, Aug 22 2015
REFERENCES
A. Cayley, Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ..., Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443.
C. F. Degen, Canon Pellianus. Hafniae, Copenhagen, 1817.
D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000 (first 150 terms from Robert G. Wilson v)
A. Cayley, Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ..., Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443. (Annotated scanned copy)
MATHEMATICA
r[x_, n_] := Reduce[lhs = x^2 - n*y^2; y > 0 && (lhs == -1 || lhs == 1 || lhs == -4 || lhs == 4), y, Integers]; a[n_ /; IntegerQ[Sqrt[n]]] = 0; xx[n_ /; IntegerQ[Sqrt[n]]] = 1; a[n_] := (x = 1; While[r[x, n] === False, x++]; xx[n] = x; y /. ToRules[r[x, n]]); A006705 = Table[yn = a[n]; Print[{n, xx[n], yn}]; yn, {n, 1, 65}] (* Jean-François Alcover, Mar 08 2012 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
3 terms corrected by Jean-François Alcover, Mar 09 2012
Extended by Ray Chandler, Aug 22 2015
STATUS
approved