OFFSET
1,3
COMMENTS
Each string is derived from the previous string using the Kolakoski(5,1) rule and the additional condition: "string begins with 1 if previous string ends with 5 and vice versa". The strings are 1 -> 5 -> 11111 -> 51515 -> 11111511111511111 -> ... and each one contains 1,1,5,5,17,... elements.
Equals inverse binomial transform of A025579. - Gary W. Adamson, Mar 04 2010
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,3,2).
FORMULA
a(1) = a(2) = 1, a(n) = a(n-1) + 2*a(n-2) - 2*(-1)^n.
From R. J. Mathar, Apr 01 2010: (Start)
G.f.: x*(1+x+2*x^2)/((1-2*x)*(1+x)^2).
a(n) = (2^(n+2) + (-1)^n*(5-6*n))/9. (End)
E.g.f.: (exp(2*x) - 9 + (5+6*x)*exp(-x))/9. - G. C. Greubel, Dec 26 2019
MAPLE
seq( (2^(n+2) + (-1)^n*(5-6*n))/9, n=1..35); # G. C. Greubel, Dec 26 2019
MATHEMATICA
Table[(2^(n+2) + (-1)^n*(5-6*n))/9, {n, 35}] (* G. C. Greubel, Dec 26 2019 *)
PROG
(PARI) vector(35, n, (2^(n+2) + (-1)^n*(5-6*n))/9) \\ G. C. Greubel, Dec 26 2019
(Magma) [(2^(n+2) + (-1)^n*(5-6*n))/9: n in [1..35]]; // G. C. Greubel, Dec 26 2019
(Sage) [(2^(n+2) + (-1)^n*(5-6*n))/9 for n in (1..35)] # G. C. Greubel, Dec 26 2019
(GAP) List([1..35], n-> (2^(n+2) + (-1)^n*(5-6*n))/9); # G. C. Greubel, Dec 26 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jun 03 2004
STATUS
approved