A267942 Interleave (n-1)^2 + 2 and (n+1)^2 + 2.
3, 3, 2, 6, 3, 11, 6, 18, 11, 27, 18, 38, 27, 51, 38, 66, 51, 83, 66, 102, 83, 123, 102, 146, 123, 171, 146, 198, 171, 227, 198, 258, 227, 291, 258, 326, 291, 363, 326, 402, 363, 443, 402, 486, 443, 531, 486, 578, 531, 627, 578, 678, 627, 731, 678, 786, 731
Offset: 0
Examples
a(0) = (2+13)/5, a(1) = (13+2)/5, a(2) = (5+5)/5, a(3) = (29+1)/5, ... (using first formula).
Links
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Crossrefs
Programs
-
Magma
&cat [[(n-1)^2+2, (n+1)^2+2]: n in [0..50]]; // Vincenzo Librandi, Jan 23 2016
-
Mathematica
Flatten[Table[{n^2 - 2 n + 3, n^2 + 2 n + 3}, {n, 0, 30}]] (* Vincenzo Librandi, Jan 23 2016 *) CoefficientList[Series[(3 - 7 x^2 + 4 x^3 + 2 x^4)/((1 - x)^3 (1 + x)^2), {x, 0, 56}], x] (* Michael De Vlieger, Jan 24 2016 *)
-
PARI
Vec((3-7*x^2+4*x^3+2*x^4)/((1-x)^3*(1+x)^2) + O(x^100)) \\ Colin Barker, Jan 22 2016
Formula
a(n+1) = a(n) + (-1)^n * A022998(n), a(0)=3.
a(n+3) = a(n) + 3*A193356(n), a(0)=a(1)=3, a(2)=2.
a(n) = 3 + A174474(n).
a(2n) + a(2n+1) = A255844(n).
From Colin Barker, Jan 22 2016: (Start)
a(n) = (2*n^2 - 6*(-1)^n*n - 2*n + 3*(-1)^n + 21)/8.
a(n) = (n^2 - 4*n + 12)/4 for n even.
a(n) = (n^2 + 2*n + 9)/4 for n odd.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 4.
G.f.: (3 - 7*x^2 + 4*x^3 + 2*x^4) / ((1-x)^3*(1+x)^2).
(End)
Extensions
More terms from Colin Barker, Jan 22 2016
Comments