OFFSET
0,3
COMMENTS
We have a(0) = 0, and for n > 0, a(n) is a subsequence of A131098 where the indices are given by the partial sums of A288382.
For n > 0, a(n) gives the number of words of length n over the alphabet A = {a,b,c,d} such that: a word containing 'c' does not contain 'b' or 'd'; a word cannot be fully written with 'a'; a word contains letters from {b,d} if and only if it contains exactly a unique couple of letters from {b,d}. Thus a(1) = 1 where the corresponding word is "c" since 'c' is the only letter allowed to be written alone.
Primes in the sequence are 7, 19, 71, 211, 367, 2267, 16747, 524971, ... which are of the form 4*k + 3 (A002145).
The second difference of this sequence is A140504.
REFERENCES
R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics: A Foundation for Computer Science, Addison-Wesley, 1994.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000 (terms 0..70 from Franck Maminirina Ramaharo)
Franck Ramaharo, Statistics on some classes of knot shadows, arXiv:1802.07701 [math.CO], 2018.
Franck Ramaharo, A generating polynomial for the pretzel knot, arXiv:1805.10680 [math.CO], 2018.
Index entries for linear recurrences with constant coefficients, signature (5,-9,7,-2)
FORMULA
G.f.: (x + 2*x^2 - 7*x^3)/((1 - x)^3*(1 - 2*x)).
a(0)=0, a(1)=1, a(2)=7, a(3)=19; for n>3, a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4).
a(n) = 2*A131924(n-1) - 1 for n>0, a(0)=0.
a(n+1) - 2*a(n) + a(n-1) = A140504(n-1) for n>0, a(0)=0.
E.g.f.: exp(2*x) - (1 - 2*x^2)*exp(x). - G. C. Greubel, Oct 17 2018
EXAMPLE
a(4) = 39. The corresponding words are aabb, aabd, aadb, aadd, abab, abad, abba, abda, adab, adad, adba, adda, aaac, aaca, aacc, acaa, acac, acca, accc, baab, baad, baba, bada, bbaa, bdaa, caaa, caac, caca, cacc, ccaa, ccac, ccca, cccc, daab, daad, daba, dada, dbaa, ddaa.
MATHEMATICA
Table[2 n (n - 1) + 2^n - 1, {n, 0, 70}]
PROG
(PARI) a(n) = 2*n*(n-1) + 2^n - 1; \\ Michel Marcus, Nov 14 2017
(Magma) [2*n*(n-1)+2^n-1 : n in [0..40]]; // Wesley Ivan Hurt, Nov 26 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Franck Maminirina Ramaharo, Nov 13 2017
STATUS
approved
