OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (9,-30,44,-24).
FORMULA
G.f.: (2-3*x)*x^3 / ((1-2*x)^3*(1-3*x)).
From Colin Barker, Feb 14 2017: (Start)
a(n) = -7*2^(n-3) + 3^n - 9*2^(n-4)*n - 2^(n-4)*n^2.
a(n) = 9*a(n-1) - 30*a(n-2) + 44*a(n-3) - 24*a(n-4) for n>4.
(End)
EXAMPLE
a(3) = 2 because 213 and 312 have exactly 1 valley and avoid 1324.
PROG
(PARI) concat(vector(2), Vec(x^3*(2-3*x) / ((1-2*x)^3*(1-3*x)) + O(x^30))) \\ Colin Barker, Feb 14 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mike Zabrocki, Nov 09 2004
STATUS
approved