OFFSET
1,1
COMMENTS
a(n) gives y-values solving the Diophantine equation x^2 + 7 = 2*y^2. A077446(n) gives the x-values. - Sture Sjöstedt, Oct 16 2012
Positive values of x (or y) satisfying x^2 - 6xy + y^2 + 28 = 0. - Colin Barker, Feb 08 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,6,0,-1).
FORMULA
a(n) = 6*a(n - 2) - a(n - 4) with a(1)=2, a(2)=4, a(3)=8, a(4)=22. - Sture Sjöstedt, Oct 16 2012
a(n)*a(n+3)-a(n+1)*a(n+2) = 10-2*(-1)^n. - Bruno Berselli, Oct 25 2012
a(n) = 2*A006452(n). - R. J. Mathar, Oct 17 2012
G.f.: -2*x*(x - 1)*(x^2 + 3*x + 1)/((x^2 - 2*x - 1)*(x^2 + 2*x - 1)). - Colin Barker, Oct 24 2012
a(n) = a(-n+1) = ((4+sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))+(4-sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2)))/4. - Bruno Berselli, Oct 25 2012
EXAMPLE
Since 2(4^2) - 7 = 25 = 5^2, and 4 is the second number with this property, a(2) = 4.
MATHEMATICA
LinearRecurrence[{0, 6, 0, -1}, {2, 4, 8, 22}, 50] (* Sture Sjöstedt, Oct 16 2012 *)
PROG
(Magma) I:=[2, 4, 8, 22]; [n le 4 select I[n] else 6*Self(n-2)-Self(n-4): n in [1..31]]; // Vincenzo Librandi, Oct 16 2012
(PARI) Vec(2*x*(1-x)*(x^2+3*x+1)/(x^2-2*x-1)/(x^2+2*x-1)+O(x^99)) \\ Charles R Greathouse IV, Oct 24 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sture Sjöstedt, Oct 16 2012
STATUS
approved