OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Kees Immink and Kui Cai, Properties and constructions of energy-harvesting sliding-window constrained codes, IEEE Comm. Lett., May 2020.
Index entries for linear recurrences with constant coefficients, signature (1,0,1,0,2,0,0,-1,0,-1).
FORMULA
a(n) = a(n-1) + a(n-3) + 2*a(n-5) - a(n-8) - a(n-10).
G.f.: 1 + x*(1+x+x^2)*(2+x^2+x^3-x^4-x^5-x^7)/(1-x-x^3-2*x^5+x^8+x^10). - R. J. Mathar, Nov 28 2011
EXAMPLE
This sequence is similar to A118647 - where no subsequence of length 4 contains 3 ones. It is obvious that the first 4 terms of these two sequences are the same. There are only 3 sequences of length 5 that contain 3 ones such that no subsequence of length 4 contains 3 ones: 10101, 11001, 10011. Hence the fifth term for this sequence is 3 less than the corresponding term of A118647.
MATHEMATICA
LinearRecurrence[{1, 0, 1, 0, 2, 0, 0, -1, 0, -1}, {1, 2, 4, 7, 11, 16, 26, 43, 71, 116, 186}, 50] (* Harvey P. Dale, Nov 27 2013 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 1 +x*(1 +x+x^2)*(2+x^2+x^3-x^4-x^5-x^7)/(1-x-x^3-2*x^5+x^8+x^10) )); // G. C. Greubel, May 05 2023
(SageMath)
def A120118_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( 1 +x*(1+x+x^2)*(2+x^2+x^3-x^4-x^5-x^7)/(1-x-x^3-2*x^5 +
x^8+x^10) ).list()
A120118_list(40) # G. C. Greubel, May 05 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tanya Khovanova, Aug 15 2006, Oct 11 2006
STATUS
approved