cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A095342 Number of elements in n-th string generated by a Kolakoski(5,1) rule starting with a(1)=1.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 03 2004

Keywords

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

Crossrefs

Cf. A025579 . - Gary W. Adamson, Mar 04 2010

Programs

  • GAP
    List([1..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
    
  • 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 *)
  • PARI
    vector(35, n, (2^(n+2) + (-1)^n*(5-6*n))/9) \\ 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
    

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