A133265 Diagonal of the A135356 triangle.
2, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
Crossrefs
Cf. A019425.
Programs
-
Magma
[(n+3+(n-1)*(-1)^(n+1))/2: n in [0..80]]; // Vincenzo Librandi, Aug 30 2011
-
Maple
A133265 := n -> (n+2+(n-2)*(-1)^n)/2: # Peter Luschny, Aug 30 2011
-
Mathematica
Table[(n + 3 + (n - 1) (-1)^(n + 1))/2, {n, 0, 79}] (* or *) Table[Mod[(2 n + 5), (n (3 + (-1)^n) - (-1)^n + 7)/2], {n, 0, 79}] (* or *) CoefficientList[Series[2 (1 + x - x^2)/((1 - x)^2*(1 + x)^2), {x, 0, 79}], x] (* Michael De Vlieger, Nov 18 2016 *)
-
PARI
Vec(2*(1 + x - x^2) / ((1 - x)^2 * (1 + x)^2) + O(x^100)) \\ Colin Barker, Nov 17 2016
Formula
2*(A057979 without 1, 0, first two terms).
a(n) = (n+3+(n-1)*(-1)^(n+1))/2. - Vincenzo Librandi, Aug 30 2011
a(n) = (2*n + 5) mod (n*(3 + (-1)^n) - (-1)^n + 7)/2. - Lechoslaw Ratajczak, Nov 17 2016
From Colin Barker, Nov 17 2016: (Start)
a(n) = 2*a(n-2) - a(n-4) for n>3.
G.f.: 2*(1 + x - x^2) / ((1 - x)^2 * (1 + x)^2).
(End)
Comments