OFFSET
0,3
COMMENTS
a(n)/A266504(n) converges to sqrt(2).
Alternatively, bisection of A266506.
Let b(n) = (a(n) - (a(n) mod 2))/2, that is b(n) = {-1, 0, 1, 2, 2, 5, 6, 13, 15, 32, 37, 78, 90, ...}. Then:
A006451(n) = {b(4n+0) U b(4n+1)} gives n in N such that triangular(n) + 1 is square;
A216134(n) = {b(4n+2) U b(4n+3)} gives n in N such that triangular(n) follows form n^2 + n + 1 (twice a triangular number + 1).
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
G.f.: (-1 + 3*x)*(1 + x)^2/(1 - 2 x^2 - x^4).
a(n) = (-(1+sqrt(2))^floor(n/2)*(-1)^n - sqrt(8)*(1-sqrt(2))^floor(n/2) - (1-sqrt(2))^floor(n/2)*(-1)^n + sqrt(8)*(1+sqrt(2))^floor(n/2))/2.
a(n) = 3*(((1+sqrt(2))^floor(n/2)-(1-sqrt(2))^floor(n/2))/sqrt(8)) - (-1)^n*(((1+sqrt(2))^(floor(n/2)-(-1)^n)-(1-sqrt(2))^(floor(n/2)-(-1)^n))/sqrt(8)).
a(n) = sqrt(2*A266504(n))^2 - 7(-1)^A266504(n))*sgn(2*n -1), where A266504 gives all x in N such that 2*x^2 - 7(-1)^x = y^2. This sequence gives associated y values.
a(2n) = (-(1 + sqrt(2))^n - sqrt(8)*(1 - sqrt(2))^n - (1 - sqrt(2))^n + sqrt(8)*(1 + sqrt(2))^n)/2 = a(2n) = A135532(n).
a(2n) = 3*(((1+sqrt(2))^n-(1-sqrt(2))^n)/sqrt(8)) - (((1+sqrt(2))^(n-1)-(1-sqrt(2))^(n-1))/sqrt(8)) = A135532(n).
a(2n+1) = (+(1 + sqrt(2))^n - sqrt(8)*(1 - sqrt(2))^n + (1 - sqrt(2))^n + sqrt(8)*(1 + sqrt(2))^n)/2 = a(2n + 1) = A048655(n).
a(2n+1) = 3*(((1+sqrt(2))^n-(1-sqrt(2))^n)/sqrt(8)) + (((1+sqrt(2))^(n+1)-(1-sqrt(2))^(n+1))/sqrt(8)) = A048655(n).
a(4n + 0) = 6*a(4n - 4) - a(4n - 8) = A255236(n-1).
a(4n + 1) = 6*a(4n - 3) - a(4n - 7) = A054490(n).
a(4n + 2) = 6*a(4n - 2) - a(4n - 6) = A038762(n).
a(4n + 3) = 6*a(4n - 1) - a(4n - 5) = A101386(n).
(sqrt(2*(a(2n + 1) )^2 + 14*(-1)^floor(n/2)))/2 = A266504(n).
(a(2n + 2) + a(2n + 1))/2 = A000129(n+2).
(a(2n + 2) - a(2n + 1))/2 = A000129(n-1).
MAPLE
a:=proc(n) option remember; if n=0 then -1 elif n=1 then 1 elif n=2 then 3 elif n=3 then 5 else 2*a(n-2)+a(n-4); fi; end: seq(a(n), n=0..50); # Wesley Ivan Hurt, Jan 01 2016
MATHEMATICA
LinearRecurrence[{0, 2, 0, 1}, {-1, 1, 3, 5}, 70] (* Vincenzo Librandi, Dec 31 2015 *)
Table[SeriesCoefficient[(-1 + 3 x) (1 + x)^2/(1 - 2 x^2 - x^4), {x, 0, n}], {n, 0, 42}] (* Michael De Vlieger, Dec 31 2015 *)
PROG
(Magma) I:=[-1, 1, 3, 5]; [n le 4 select I[n] else 2*Self(n-2)+Self(n-4): n in [1..70]]; // Vincenzo Librandi, Dec 31 2015
(PARI) x='x+O('x^30); Vec((-1+3*x)*(1+x)^2/(1-2*x^2-x^4)) \\ G. C. Greubel, Jul 26 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Raphie Frank, Dec 30 2015
STATUS
approved