login
A095342
Number of elements in n-th string generated by a Kolakoski(5,1) rule starting with a(1)=1.
6
1, 1, 5, 5, 17, 25, 61, 109, 233, 449, 917, 1813, 3649, 7273, 14573, 29117, 58265, 116497, 233029, 466021, 932081, 1864121, 3728285, 7456525, 14913097, 29826145, 59652341, 119304629, 238609313, 477218569, 954437197, 1908874333, 3817748729
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
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
Cf. A025579 . - Gary W. Adamson, Mar 04 2010
Sequence in context: A146132 A282982 A282952 * A100745 A373275 A283089
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jun 03 2004
STATUS
approved