OFFSET
1,2
COMMENTS
Non-palindromic vs palindromic (DNA) sequences (e.g., {a,c,a,c} is a non-palindromic sequence but {a,c,c,a} is palindromic). Useful in bioinformatics.
LINKS
Index entries for linear recurrences with constant coefficients, signature (4,4,-16).
FORMULA
a(n) = 2^(n-1) * (2^(n+1) + (-1)^n - 3).
From Colin Barker, Aug 12 2014: (Start)
a(n) = 4*a(n-1) + 4*a(n-2) - 16*a(n-3).
G.f.: 12*x^2 / ((2*x-1)*(2*x+1)*(4*x-1)). (End)
EXAMPLE
For n=2 the a(2)=12 solutions (non-palindromic 2-tuples over 4 distinct elements {a,c,g,t}) are: {a,c}, {a,g}, {a,t}, {c,a}, {c,g}, {c,f}, {g,a},{g,c}, {g,t}, {t,a}, {t,c}, {t,g}.
MATHEMATICA
Table[2^(n-1) * (2^(n+1) + (-1)^n - 3), {n, 66}]
LinearRecurrence[{4, 4, -16}, {0, 12, 48}, 30] (* Harvey P. Dale, May 24 2023 *)
PROG
(PARI) a(n) = ((-1)^n - 3)*2^(n-1) + 4^n; \\ Michel Marcus, Aug 12 2014
(PARI) concat(0, Vec(12*x^2 / ((2*x-1)*(2*x+1)*(4*x-1)) + O(x^100))) \\ Colin Barker, Aug 12 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Aug 12 2014
EXTENSIONS
Typos in formula fixed by Colin Barker, Aug 12 2014
STATUS
approved