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

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

Original entry on oeis.org

1, 1, 7, 7, 31, 49, 145, 289, 727, 1591, 3775, 8545, 19873, 45505, 105127, 241639, 557023, 1281937, 2953009, 6798817, 15657847, 36054295, 83027839, 191190721, 440274241, 1013846401, 2334669127, 5376208327, 12380215711, 28508840689
Offset: 1

Views

Author

Benoit Cloitre, Jun 03 2004

Keywords

Comments

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

Crossrefs

Programs

  • GAP
    a:=[1,1];; for n in [3..35] do a[n]:=a[n-1]-3*a[n-2]-3*(-1)^n; od; a; # G. C. Greubel, Dec 26 2019
  • Magma
    I:=[1,1]; [n le 2 select I[n] else Self(n-1) + 3*Self(n-2) - 3*(-1)^n: n in [1..35]]; // G. C. Greubel, Dec 26 2019
    
  • Maple
    seq(coeff(series(x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)), x, n+1), x, n), n = 0..35); # G. C. Greubel, Dec 26 2019
  • Mathematica
    Table[ 3*(-1)^n + 2*Sqrt[3]^n*(Sqrt[3]*Fibonacci[n, 1/Sqrt[3]] - Fibonacci[n+1, 1/Sqrt[3]]), {n,35}]//FullSimplify (* G. C. Greubel, Dec 26 2019 *)
  • PARI
    vector(35, n, round(3*(-1)^n + 2*(sqrt(3)/I)^n*(sqrt(3)*I* polchebyshev(n-1, 2, I/(2*sqrt(3))) - polchebyshev(n, 2, I/(2*sqrt(3)))) )) \\ G. C. Greubel, Dec 26 2019
    
  • Sage
    def A095343_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)) ).list()
    a=A095343_list(35); a[1:] # G. C. Greubel, Dec 26 2019
    

Formula

a(1) = a(2) = 1, a(n) = a(n-1) + 3*a(n-2) - 3*(-1)^n.
G.f.: x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)). - Colin Barker, Jul 02 2012
a(n) = 3*(-1)^n + 2*(sqrt(3)/i)^n*(sqrt(3)*i*ChebyshevU(n, i/(2*sqrt(3))) - ChebyshevU(n-1, i/(2*sqrt(3)))). - G. C. Greubel, Dec 26 2019

A025579 a(1)=1, a(2)=2, a(n) = 4*3^(n-3) for n >= 3.

Original entry on oeis.org

1, 2, 4, 12, 36, 108, 324, 972, 2916, 8748, 26244, 78732, 236196, 708588, 2125764, 6377292, 19131876, 57395628, 172186884, 516560652, 1549681956, 4649045868, 13947137604, 41841412812, 125524238436, 376572715308, 1129718145924
Offset: 1

Views

Author

Keywords

Comments

a(n) is the sum of the numbers in row n+1 of the array defined in A025564 (and of the array in A024996).
a(n) is the number of (s(0), s(1), ..., s(n)) such that every s(i) is an integer, s(0) = 0, |s(i) - s(i-1)| = 1 for i = 1,2; |s(i) - s(i-1)| <= 1 for i >= 3.
Equals binomial transform of A095342: (1, 1, 5, 5, 17, 25, 61, ...). - Gary W. Adamson, Mar 04 2010

Crossrefs

Programs

  • GAP
    Concatenation([1,2], List([3..30], n-> 4*3^(n-3) )); # G. C. Greubel, Dec 26 2019
  • Magma
    [1,2] cat [4*3^(n-3): n in [3..30]]; // G. C. Greubel, Dec 26 2019
    
  • Maple
    seq( `if`(n<3, n, 4*3^(n-3)), n=1..30); # G. C. Greubel, Dec 26 2019
  • Mathematica
    Join[{1,2},4*3^Range[0,30]] (* or *) Join[{1,2},NestList[3#&,4,30]] (* Harvey P. Dale, Jun 27 2011 *)
  • PARI
    a(n)=max(n,4*3^(n-3)) \\ Charles R Greathouse IV, Jun 28 2011
    
  • PARI
    Vec(x*(1+x)*(1-2*x)/(1-3*x) + O(x^30)) \\ Colin Barker, Oct 29 2019
    
  • Sage
    [1,2]+[4*3^(n-3) for n in (3..30)] # G. C. Greubel, Dec 26 2019
    

Formula

a(n) = A003946(n-2), n>2. - R. J. Mathar, May 28 2008
From Colin Barker, Oct 29 2019: (Start)
G.f.: x*(1 + x)*(1 - 2*x) / (1 - 3*x).
a(n) = 3*a(n-1) for n>3. (End)

Extensions

Definition corrected by R. J. Mathar, May 28 2008

A103196 a(n) = (1/9)(2^(n+3)-(-1)^n(3n-1)).

Original entry on oeis.org

1, 2, 3, 8, 13, 30, 55, 116, 225, 458, 907, 1824, 3637, 7286, 14559, 29132, 58249, 116514, 233011, 466040, 932061, 1864142, 3728263, 7456548, 14913073, 29826170, 59652315, 119304656, 238609285, 477218598, 954437167
Offset: 0

Views

Author

Creighton Dement, Mar 18 2005

Keywords

Comments

A floretion-generated sequence relating to the Jacobsthal sequence A001045 as well as to A095342 (Number of elements in n-th string generated by a Kolakoski(5,1) rule starting with a(1)=1). (a(n)) may be seen as the result of a certain transform of the natural numbers (see program code).
Floretion Algebra Multiplication Program, FAMP Code: 4jesleftforseq[A*B] with A = + 'i + 'j + i' + j' + 'ii' + 'jj' + 'ij' + 'ji' + e and B = - .25'i + .25'j + .25'k + .25i' - .25j' + .25k' - .25'ii' + .25'jj' + .25'kk' + .25'ij' + .25'ik' + .25'ji' + .25'jk' - .25'ki' - .25'kj' - .25e; 1vesforseq[A*B](n) = n, ForType: 1A.

Crossrefs

Programs

  • Mathematica
    Table[(2^(n+3)-(-1)^n (3n-1))/9,{n,0,30}] (* or *) LinearRecurrence[ {0,3,2},{1,2,3},40] (* Harvey P. Dale, Jul 09 2018 *)

Formula

G.f. (2x+1)/((1-2x)(x+1)^2); Superseeker results: a(n) + a(n+1) = A001045(n+3); a(n+1) - a(n) = A095342(n+1); a(n+2) - a(n+1) - a(n) = A053088(n+1) = A034299(n+1) - A034299(n); a(n) + 2a(n+1) + a(n+2) = 2^(n+3); a(n+2) - 2a(n+1) + a(n) = A053088(n+1) - A053088(n); a(n+2) - a(n) = A001045(n+4) - A001045(n+3) = A052953(n+3) - A052953(n+2) = A026644(n+2) - A026644(n+1);
a(n)=sum{k=0..n+2, (-1)^(n-k)*C(n+2, k)phi(phi(3^k))}; a(n)=sum{k=0..n+2, (-1)^(n-k)*C(n+2, k)(2*3^k/9+C(1, k)/3+4*C(0, k)/9)}; a(n)=sum{k=0..n+2, J(n-k+3)((-1)^(k+1)-2C(1, k)+4C(0, k))} where J(n)=A001045(n); a(n)=A113954(n+2). - Paul Barry, Nov 09 2005

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.