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.

Showing 1-5 of 5 results.

A095344 Length of n-th string generated by a Kolakoski(9,1) rule starting with a(1)=1.

Original entry on oeis.org

1, 1, 9, 9, 49, 81, 281, 601, 1729, 4129, 11049, 27561, 71761, 182001, 469049, 1197049, 3073249, 7861441, 20154441, 51600201, 132217969, 338618769, 867490649, 2221965721, 5691928321, 14579791201, 37347504489, 95666669289, 245056687249, 627723364401
Offset: 1

Views

Author

Benoit Cloitre, Jun 03 2004

Keywords

Comments

Each string is derived from the previous string using the Kolakoski(9,1) rule and the additional condition: "string begins with 1 if previous string ends with 9 and vice versa". The strings are 1 -> 9 -> 111111111 -> 919191919 -> 11111111191111111119... -> ... and each one contains 1,1,9,9,31,... elements.

Crossrefs

Programs

  • GAP
    a:=[1,1,9];; for n in [4..35] do a[n]:=5*a[n-2]+4*a[n-3]; od; a; # G. C. Greubel, Dec 26 2019
  • Haskell
    a095344 n = a095344_list !! (n-1)
    a095344_list = tail xs where
       xs = 1 : 1 : 1 : zipWith (-) (map (* 5) $ zipWith (+) (tail xs) xs) xs
    -- Reinhard Zumkeller, Aug 16 2013
    
  • Magma
    R:=PowerSeriesRing(Integers(), 35); Coefficients(R!( x*(1+x+ 4*x^2)/((1+x)*(1-x-4*x^2)) )); // G. C. Greubel, Dec 26 2019
    
  • Maple
    seq(simplify(2*(-1)^n -(2/I)^n*(ChebyshevU(n, I/4) -2*I*ChebyshevU(n-1, I/4)) ), n = 1..35); # G. C. Greubel, Dec 26 2019
  • Mathematica
    Table[2*(-1)^n - 2^n*(Fibonacci[n+1, 1/2] - 2*Fibonacci[n, 1/2]), {n,35}] (* G. C. Greubel, Dec 26 2019 *)
    LinearRecurrence[{0,5,4},{1,1,9},40] (* Harvey P. Dale, Oct 12 2022 *)
  • PARI
    Vec(x*(1+x+4*x^2)/((1+x)*(1-x-4*x^2)) + O(x^50)) \\ Colin Barker, Apr 20 2016
    
  • PARI
    vector(35, n, round( 2*(-1)^n - (2/I)^n*(polchebyshev(n, 2, I/4) -2*I*polchebyshev(n-1, 2, I/4)) )) \\ G. C. Greubel, Dec 26 2019
    
  • Sage
    def A095344_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+x+4*x^2)/((1+x)*(1-x-4*x^2)) ).list()
    a=A095344_list(35); a[1:] # G. C. Greubel, Dec 26 2019
    

Formula

a(1) = a(2) = 1; for n>1, a(n) = a(n-1) + 4*a(n-2) - 4*(-1)^n.
G.f.: x*(1 + x + 4*x^2)/((1 + x)*(1 - x - 4*x^2)). - Colin Barker, Mar 25 2012
a(n) = 5*a(n-2) + 4*a(n-3). - Colin Barker, Mar 25 2012
a(n) = 2*(-1)^n + (2^(-1-n)*(-(-7+sqrt(17))*(1+sqrt(17))^n - (1-sqrt(17))^n*(7+sqrt(17))))/sqrt(17). - Colin Barker, Apr 20 2016
a(n) = 2*(-1)^n - 2^n*(Fibonacci(n+1, 1/2) - 2*Fibonacci(n, 1/2)) = 2*(-1)^n - (2/I)^n*(ChebyshevU(n, I/4) - 2*I*ChebyshevU(n-1, I/4)). - G. C. Greubel, Dec 26 2019

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

A095345 a(n) is the length of the n-th run in A095346.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1
Offset: 1

Views

Author

Benoit Cloitre, Jun 03 2004

Keywords

Comments

This is the first sequence reached in the infinite process described in the A066983 comment line.
(a(n)) is a morphic sequence, i.e., a letter to letter projection of a fixed point of a morphism. The morphism is 1->121,2->3,1,3->313. The fixed point is the fixed point 121312131312... starting with 1. The letter-to-letter map is 1->1, 2->1, 3->3. See also the comments in A108103. - Michel Dekking, Jan 06 2018

Examples

			A095346 begins: 3,1,3,1,1,1,3,1,3,1,1,1,3,1,1,1,... and length or runs of 3's and 1's are 1,1,1,3,1,1,1,3,1,3,...
		

References

  • F. M. Dekking: "What is the long range order in the Kolakoski sequence?" in: The Mathematics of Long-Range Aperiodic Order, ed. R. V. Moody, Kluwer, Dordrecht (1997), pp. 115-125.

Crossrefs

Formula

a(n)=3 if n=2*ceiling(k*phi) for some k where phi=(1+sqrt(5))/2, otherwise a(n)=1. [Benoit Cloitre, Mar 02 2009]

A095346 a(n) is the length of the n-th run of A095345.

Original entry on oeis.org

3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Jun 03 2004

Keywords

Comments

This is the second sequence reached in the infinite process described in A066983 comment line.
(a(n)) is a morphic sequence, i.e., a letter to letter projection of a fixed point of a morphism. The morphism is 1->121,2->3,1,3->313. The fixed point is the fixed point 3131213131213... starting with 3. The letter-to-letter map is 1->1, 2->1, 3->3. See also COMMENTS of A108103. - Michel Dekking, Jan 06 2018

Examples

			A095345 begins : 1,1,1,3,1,1,1,3,1,3,...,.. and length or runs of 1's and 3's are 3,1,3,1,1,1,...
		

References

  • F. M. Dekking: "What is the long range order in the Kolakoski sequence?" in: The Mathematics of Long-Range Aperiodic Order, ed. R. V. Moody, Kluwer, Dordrecht (1997), pp. 115-125.

Crossrefs

Formula

a(n)=3 if n=1+2*floor(phi*k) for some k where phi=(1+sqrt(5))/2, else a(n)=1. [Benoit Cloitre, Mar 02 2009]

A124389 A square array of Kolakoski string lengths, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 5, 1, 1, 1, 1, 7, 5, 7, 1, 1, 1, 1, 9, 17, 7, 9, 1, 1, 1, 1, 17, 25, 31, 9, 11, 1, 1, 1, 1, 25, 61, 49, 49, 11, 13, 1, 1, 1, 1, 43, 109, 145, 81, 71, 13, 15, 1, 1, 1
Offset: 0

Views

Author

Paul Barry, Oct 30 2006

Keywords

Comments

Rows of square array include A066983,A095342,A095343,A095344. See A066983 for description of Kolakoski strings. Sums of antidiagonals is A124390.

Examples

			Square array begins
1, 1, 1, 1, 1, 1, 1...
1, 1, 1, 3, 3, 7, 9...
1, 1, 1, 5, 5, 17, 25...
1, 1, 1, 7, 7, 31, 49...
1, 1, 1, 9, 9, 49, 81...
1, 1, 1, 11, 11, 71, 121...
1, 1, 1, 13, 13, 97, 169...
As a number triangle, triangle begins
1,
1, 1,
1, 1, 1,
1, 1, 1, 1,
1, 3, 1, 1, 1,
1, 3, 5, 1, 1, 1,
1, 7, 5, 7, 1, 1, 1,
1, 9, 17, 7, 9, 1, 1, 1,
1, 17, 25, 31, 9, 11, 1, 1, 1
		

Formula

Row k of square array has g.f. (1+x-kx^2)/((1+x)(1-x-kx^2))
Showing 1-5 of 5 results.