OFFSET
1,4
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-2,1,-2,-1,2).
FORMULA
a(n) = a(n-1) + a(n-2) + a(n-4) - a(n-6) + 13*2^(n-6).
a(n) = +3*a(n-1) -a(n-2) -2*a(n-3) +a(n-4) -2*a(n-5) -a(n-6) +2*a(n-7).
G.f.: x^3*(1+2*x-x^2-x^3)/( (1-2*x)*(1-x-x^2-x^4+x^6) ). - R. J. Mathar, Nov 28 2011
EXAMPLE
a(4) is 5 because only the following binary strings of length 4 satisfy the conditions: 0111, 1011, 1101, 1011, 1111.
MATHEMATICA
LinearRecurrence[{3, -1, -2, 1, -2, -1, 2}, {0, 0, 1, 5, 13, 31, 71}, 41] (* G. C. Greubel, May 05 2023 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); [0, 0] cat Coefficients( R!( x^3*(1+2*x-x^2-x^3)/((1-2*x)*(1-x-x^2-x^4+x^6)) )); // G. C. Greubel, May 05 2023
(SageMath)
def A118646_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x^3*(1+2*x-x^2-x^3)/((1-2*x)*(1-x-x^2-x^4+x^6)) ).list()
a=A118646_list(41); a[1:] # G. C. Greubel, May 05 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Tanya Khovanova, May 10 2006, Aug 17 2006
STATUS
approved