OFFSET
0,2
COMMENTS
a(n-1) is the number of compositions of n into floor((3*j-1)/2) kinds of j's for all j >= 1. The sequence of such compositions is 1,1,3,9,24,... (i.e., this sequence prepended by 1) and has g.f. 1/(1-Sum_{j>=1} floor((3*j-1)/2)*x^j). - Joerg Arndt, Jul 06 2011
a(n) is the number of length n words on 3 letters (ternary words) such that the length of any run of identical letters is <= 2. Cf. A181137 for a generalization. - Geoffrey Critzer, Sep 16 2013
REFERENCES
A. Burstein and T. Mansour, Words restricted by 3-letter generalized multipermutation patterns, Annals. Combin., 7 (2003), 1-14.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
A. Burstein and T. Mansour, Words restricted by 3-letter generalized multipermutation patterns, arXiv:math/0112281 [math.CO], 2001.
Martin Burtscher, Igor Szczyrba, Rafał Szczyrba, Analytic Representations of the n-anacci Constants and Generalizations Thereof, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.5.
Index entries for linear recurrences with constant coefficients, signature (2,2).
FORMULA
a(0)=1, a(1)=3, a(2)=9; a(n) = 2*a(n-1) + 2*a(n-2) for n>=3. - Philippe Deléham, Sep 19 2009
G.f.: (1/x)*(-1 + 1/(1-Sum_{j>=1} floor((3*j-1)/2)*x^j)). - Joerg Arndt, Jul 06 2011
E.g.f.: (1/2)*exp(x)*(3*cosh(sqrt(3)*x) + sqrt(3)*sinh(sqrt(3)*x)) - 1/2. - Stefano Spezia, Oct 08 2019
MAPLE
seq(coeff(series((1+x+x^2)/(1-2*x-2*x^2), x, n+1), x, n), n = 0..30); # G. C. Greubel, Oct 07 2019
MATHEMATICA
CoefficientList[Series[(1+x+x^2)/(1-2x-2x^2), {x, 0, 30}], x] (* or *) LinearRecurrence[{2, 2}, {1, 3, 9}, 30] (* Harvey P. Dale, Dec 03 2011 *)
PROG
(PARI) my(x='x+O('x^30)); Vec((1+x+x^2)/(1-2*x-2*x^2)) \\ G. C. Greubel, Oct 07 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1+x+x^2)/(1-2*x-2*x^2) )); // G. C. Greubel, Oct 07 2019
(Sage)
def A121907_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+x+x^2)/(1-2*x-2*x^2)).list()
A121907_list(30) # G. C. Greubel, Oct 07 2019
(GAP) a:=[3, 9];; for n in [3..30] do a[n]:=2*(a[n-1]+a[n-2]); od; Concatenation([1], a); # G. C. Greubel, Oct 07 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 20 2006
STATUS
approved