OFFSET
1,2
COMMENTS
A Pellian equation (Pell's equation). - Benoit Cloitre, Feb 03 2006
The corresponding values of y are in A174766. - Vincenzo Librandi, Dec 21 2011
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Tanya Khovanova, Recursive Sequences
John Robertson, Home page.
Index entries for linear recurrences with constant coefficients, signature (394,-1).
FORMULA
a(n) = 394*a(n-1) - a(n-2); a(1)=1, a(2)=197. - Benoit Cloitre, Feb 03 2006
G.f.: x*(1-197*x)/(1 - 394*x + x^2). - Philippe Deléham, Nov 18 2008
MATHEMATICA
LinearRecurrence[{394, -1}, {1, 197}, 20] (* Harvey P. Dale, Nov 03 2011 *)
PROG
(PARI) g(n, k=22) = for(y=0, n, x=k*y^2+1; if(issquare(x), print1(sqrtint(x), ", ")))
(PARI) a=vector(12); a[1]=1; a[2]=197; for(i=3, #a, a[i]=394*a[i-1]-a[i-2]); a \\ Benoit Cloitre, Feb 03 2006
(Magma) I:=[1, 197]; [n le 2 select I[n] else 394*Self(n-1)-Self(n-2): n in [1..40]]; // Vincenzo Librandi, Dec 21 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Cino Hilliard, Feb 01 2006
EXTENSIONS
More terms from Benoit Cloitre, Feb 03 2006
Offset changed from 0 to 1, g.f. and formula adapted by Vincenzo Librandi, Dec 21 2011
STATUS
approved