This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A006703 M0399 #37 Dec 26 2021 21:50:33 %S A006703 0,1,1,0,1,2,3,1,0,1,3,2,5,4,1,0,1,4,39,2,12,42,5,1,0,1,5,24,13,2,273, %T A006703 3,4,6,1,0,1,6,4,3,5,2,531,30,24,3588,7,1,0,1,7,90,25,66,12,2,20,13, %U A006703 69,4,3805,8,1,0,1,8,5967,4,936,30,413,2,125,5,3,6630,40,6,9 %N A006703 Solution to Pellian: y such that x^2 - n*y^2 = +-1. %D A006703 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. %D A006703 C. F. Degen, Canon Pellianus. Hafniae, Copenhagen, 1817. %D A006703 D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55. %D A006703 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006703 T. D. Noe, <a href="/A006703/b006703.txt">Table of n, a(n) for n=1..10000</a> %H A006703 A. Cayley, <a href="/A002349/a002349.pdf">Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ...</a>, Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443. (Annotated scanned copy) %H A006703 M. Zuker, <a href="http://www.bioinfo.rpi.edu/~zukerm/cgi-bin/dq.html">Fundamental solution to Pell's Equation x^2 - d*y^2 = +-1</a> [Broken link] %t A006703 r[x_, n_] := Reduce[ y > 0 && (x^2 - n*y^2 == -1 || x^2 - n*y^2 == 1 ), y, Integers]; a[n_ /; IntegerQ[ Sqrt[n]]] = 0; a[n_] := a[n] = (k = 1; While[r[k, n] === False, k++]; y /. ToRules[r[k, n]]); Table[ Print[ a[n] ]; a[n], {n, 1, 79}] (* _Jean-François Alcover_, Jan 30 2012 *) %t A006703 nmax = 500; %t A006703 nconv = 200; (* The number of convergents'nconv' should be increased if the linear recurrence is not found for some terms. *) %t A006703 x[n_] := x[n] = Module[{lr}, If[IntegerQ[Sqrt[n]], 1, lr = FindLinearRecurrence[ Numerator[ Convergents[Sqrt[n], nconv]]]; SelectFirst[lr, # > 1 &]/2]]; %t A006703 a[n_] := If[n == 2, 1, SelectFirst[{Sqrt[(x[n]^2 - 1)/n], Sqrt[(x[n]^2 + 1)/n]}, IntegerQ]]; %t A006703 Array[a, nmax] // Quiet (* _Jean-François Alcover_, Mar 08 2021 *) %Y A006703 Cf. A006702 (for the x values), A077233. %K A006703 nonn %O A006703 1,6 %A A006703 _N. J. A. Sloane_ %E A006703 Corrected and extended by _T. D. Noe_, May 19 2007