OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
W. Griffiths, R. Smith and D. Warren, Almost avoiding pairs of permutations, PU. M. A. Vol. 22 (2011), 129-139.
Index entries for linear recurrences with constant coefficients, signature (7,-18,20,-8).
FORMULA
a(n) = 7*a(n-1)-18*a(n-2)+20*a(n-3)-8*a(n-4). G.f.: -x*(4*x^3-10*x^2+5*x-1)/((x-1)*(2*x-1)^3). [Colin Barker, Oct 17 2012]
MATHEMATICA
Table[(n-2) (n-3) 2^(n-2) + 2^n - 2, {n, 30}] (* Vincenzo Librandi, Mar 11 2013 *)
LinearRecurrence[{7, -18, 20, -8}, {1, 2, 6, 22}, 30] (* Harvey P. Dale, Aug 08 2021 *)
PROG
(Maxima) makelist((n-2)*(n-3)*2^(n-2)+2^n-2, n, 1, 30); /* Martin Ettl, Oct 15 2012 */
(Magma) [(n-2)*(n-3)*2^(n-2)+2^n-2: n in [1..30]]; // Vincenzo Librandi, Mar 11 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Oct 13 2012
STATUS
approved