OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-3,2).
FORMULA
a(n) = 2*floor((2*2^n-3*n-1)/6).
a(n) = 2*A178420(n-1).
From Colin Barker, Apr 19 2015: (Start)
a(n) = (-3-(-1)^n+2^(2+n)-6*n)/6.
a(n) = 3*a(n-1)-a(n-2)-3*a(n-3)+2*a(n-4).
G.f.: -2*x^3 / ((x-1)^2*(x+1)*(2*x-1)).
(End)
EXAMPLE
a(3)=2: (1 3 2, 3 1 2).
a(4)=6: (1 2 4 3, 1 3 2 4, 1 4 2 3, 1 3 4 2, 3 1 2 4, 3 4 1 2).
MATHEMATICA
Table[2 Floor[(2 2^n - 3 n - 1) / 6], {n, 50}] (* Vincenzo Librandi, Apr 18 2015 *)
PROG
(Magma) [2*Floor((2*2^n-3*n-1)/6): n in [1..40]]; // Vincenzo Librandi, Apr 18 2015
(PARI) concat([0, 0], Vec(-2*x^3/((x-1)^2*(x+1)*(2*x-1)) + O(x^100))) \\ Colin Barker, Apr 19 2015
(PARI) a(n)=(2<<n-3*n-1)\6*2 \\ Charles R Greathouse IV, Apr 21 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ran Pan, Apr 18 2015
STATUS
approved