OFFSET
0,1
COMMENTS
This sequence gives all x in N | 2*x^2 - 7(-1)^x = y^2. The companion sequence to this sequence, giving y values, is A266505.
A266505(n)/a(n) converges to sqrt(2).
Alternatively, 1/4*(3*A002203(floor[n/2]) - A002203(n-(-1)^n)), where A002203 gives the Companion Pell numbers, or, in Lucas sequence notation, V_n(2, -1).
Alternatively, bisection of A266506.
Let b(n) = (a(n) - a(n)(mod 2))/2, that is b(n) = {1, 1, 0, 1, 2, 4, 4, 9, 11, 23, 26, 55, 64, ...}. Then:
A006452(n) = {b(4n+0) U b(4n+1)} gives n in N such that n^2 - 1 is triangular;
A216134(n) = {b(4n+2) U b(4n+3)} gives n in N such that n^2 + n + 1 is triangular (indices of Sophie Germain triangular numbers);
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,1).
FORMULA
a(n) = 1/sqrt(8)*(+sqrt(2)*(1+sqrt(2))^(floor(n/2)-(-1)^n)*(-1)^n - 3*(1-sqrt(2))^(floor(n/2)-(-1)^n) + sqrt(2)*(1-sqrt(2))^(floor(n/2)-(-1)^n)*(-1)^n + 3*(1+sqrt(2))^(floor(n/2)-(-1)^n)).
a(n) = 1/4*((3*((1+sqrt(2))^floor(n/2)+(1-sqrt(2))^floor(n/2))) - (-1)^n*((1+sqrt(2))^(floor(n/2)-(-1)^n)+(1-sqrt(2))^(floor(n/2)-(-1)^n))).
a(2n) = (+sqrt(2)*(1+sqrt(2))^(n-1) - 3 *(1-sqrt(2))^(n-1) + sqrt(2)*(1-sqrt(2))^(n-1) + 3*(1 + sqrt(2))^(n-1))/sqrt(8) = A048654(n -1).
a(2n) = 1/4*((3*((1+sqrt(2))^n+(1-sqrt(2))^n)) - ((1+sqrt(2))^(n-1)+(1-sqrt(2))^(n-1))) = A048654(n -1).
a(2n + 1) = (-sqrt(2)*(1+sqrt(2))^(n+1) - 3 *(1-sqrt(2))^(n+1) - sqrt(2)*(1-sqrt(2))^(n+1) + 3*(1+sqrt(2))^(n+1))/sqrt(8) = A078343(n + 1).
a(2n + 1) =1/4*((3*((1+sqrt(2))^n+(1-sqrt(2))^n)) + ((1+sqrt(2))^(n+1)+(1-sqrt(2))^(n+1))) = A078343(n + 1).
a(4n + 0) = 6*a(4n - 4) - a(4n - 8) = A100525(n-1).
a(4n + 1) = 6*a(4n - 3) - a(4n - 7) = A266507(n).
a(4n + 2) = 6*a(4n - 2) - a(4n - 6) = A038761(n).
a(4n + 3) = 6*a(4n - 1) - a(4n - 5) = A253811(n).
sqrt(2*a(n)^2 - 7(-1)^a(n))*sgn(2*n - 1) = A266505(n).
(a(2n+2) + a(2n+1))*2 = A002203(n+2)
(a(2n+2) - a(2n+1))*2 = A002203(n-1).
G.f.: (1-x)*(2+4*x+x^2) / (1-2*x^2-x^4). - Colin Barker, Dec 31 2015
MATHEMATICA
LinearRecurrence[{0, 2, 0, 1}, {2, 2, 1, 3}, 70] (* Vincenzo Librandi, Dec 31 2015 *)
Table[SeriesCoefficient[(1 - x) (2 + 4 x + x^2)/(1 - 2 x^2 - x^4), {x, 0, n}], {n, 0, 41}] (* Michael De Vlieger, Dec 31 2015 *)
PROG
(Magma) I:=[2, 2, 1, 3]; [n le 4 select I[n] else 2*Self(n-2)+Self(n-4): n in [1..70]]; // Vincenzo Librandi, Dec 31 2015
(PARI) Vec((1-x)*(2+4*x+x^2)/(1-2*x^2-x^4) + O(x^50)) \\ Colin Barker, Dec 31 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Raphie Frank, Dec 30 2015
STATUS
approved