OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: x*(1+31*x+47*x^2+5*x^3) / (x-1)^4.
a(0) = 0, a(n) = 1+(6+(14+14*(n-1))*(n-1))*(n-1) for n>0.
EXAMPLE
a(2) = 35: aaaaaaaa, aaaaaabb, aaaaabba, aaaabaab, aaaabbaa, aaaabbbb, aaabaaba, aaabbaaa, aaabbabb, aaabbbba, aabaaaab, aabaabaa, aabaabbb, aababbab, aabbaaaa, aabbaabb, aabbabba, aabbbaab, aabbbbaa, aabbbbbb, abaaaaba, abaabaaa, abaababb, abaabbba, ababbaba, abbaaaaa, abbaaabb, abbaabba, abbabaab, abbabbaa, abbabbbb, abbbaaba, abbbbaaa, abbbbabb, abbbbbba (with 2-ary alphabet {a,b}).
MAPLE
a:= n-> `if`(n=0, 0, (x-> 1+(6+(14+14*x)*x)*x)(n-1)):
seq(a(n), n=0..40);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 02 2011
STATUS
approved