login
A014131
a(n) = 2*a(n-1) if n odd else 2*a(n-1) + 6.
1
0, 6, 12, 30, 60, 126, 252, 510, 1020, 2046, 4092, 8190, 16380, 32766, 65532, 131070, 262140, 524286, 1048572, 2097150, 4194300, 8388606, 16777212, 33554430, 67108860, 134217726, 268435452, 536870910, 1073741820, 2147483646, 4294967292, 8589934590, 17179869180
OFFSET
0,2
FORMULA
a(n) = 3*A026644(n), n > 0. [moved from A020988 by R. J. Mathar, Oct 21 2008]
From R. J. Mathar, Oct 21 2008: (Start)
G.f.: 6*x/((1-2*x)*(1-x)*(1+x)).
a(n) = 2^(n+2) - 3 - (-1)^n. (End)
a(n) ~ 4*2^n. - Charles R Greathouse IV, May 31 2026
From Elmo R. Oliveira, Aug 23 2026: (Start)
a(n) = 6*A000975(n) = 2*A141023(n+1).
E.g.f.: 2*(2*exp(2*x) - 2*cosh(x) - sinh(x)). (End)
MATHEMATICA
Table[2^(n+2)-3-(-1)^n, {n, 0, 40}] (* Vincenzo Librandi, Apr 03 2012 *)
(* Alternative: *)
CoefficientList[Series[6x/((1-2x)(1-x)(1+x)), {x, 0, 40}], x] (* Vincenzo Librandi, Apr 03 2012 *)
(* Alternative: *)
nxt[{n_, a_}]:={n+1, If[EvenQ[n], 2a, 2a+6]}; NestList[nxt, {1, 0}, 40][[;; , 2]] (* Harvey P. Dale, Aug 26 2024 *)
(* Alternative: *)
LinearRecurrence[ {2, 1, -2}, {0, 6, 12}, 40] (* Harvey P. Dale, Aug 26 2024 *)
PROG
(Magma) [2^(n+2)-3-(-1)^n: n in [0..30]]; // Vincenzo Librandi, Apr 03 2012
(PARI) a(n)=4*2^n-3-(-1)^n \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,easy,changed
STATUS
approved