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-3 of 3 results.

A065455 Number of (binary) bit strings of length n in which no even block of 0's is followed by an odd block of 1's.

Original entry on oeis.org

1, 2, 4, 7, 14, 25, 49, 89, 172, 316, 605, 1120, 2131, 3965, 7513, 14026, 26504, 49591, 93538, 175277, 330205, 619369, 1165892, 2188312, 4117045, 7730828, 14539447, 27309529, 51349169, 96468034, 181357036, 340753271, 640539142, 1203616849
Offset: 0

Views

Author

Len Smiley, Nov 24 2001

Keywords

Comments

The limit of the ratio of successive terms as n increases can be shown to be 2*cos(Pi/9). In the opposite direction, as n -> -oo (see A052545), a(n+1)/a(n) approaches 2*cos(5*Pi/9). For example, a(-6)/a(-7) = -92/265, which is close to 2*cos(5*Pi/9). - Richard Locke Peterson, Apr 22 2019
Let P(n, j, m) = Sum_{r=1..m} (2^n*(1-(-1)^r)*cos(Pi*r/(m+1))^n*cot(Pi*r/(2*(m+1)))* sin(j*Pi*r/(m+1)))/(m+1) denote the number of paths of length n starting at the j-th node on the path graph P_m. We have a(n) = P(n, 3, 8). - Herbert Kociemba, Sep 17 2020

Examples

			a(5) = 32-7 = 25 because 00111, 00101, 00100, 10010, 01001, 11001, 00001 are forbidden.
		

Crossrefs

Cf. A061279 (forbids odd block 0's-odd block 1's), A065494, A065495, A065497.
Cf. A052545 (this is what we get if n takes negative values).

Programs

  • GAP
    a:=[1,2,4];; for n in [4..40] do a[n]:=3*a[n-2]+a[n-3]; od; a; # G. C. Greubel, May 31 2019
  • Magma
    I:=[1,2,4]; [n le 3 select I[n] else 3*Self(n-2) +Self(n-3): n in [1..40]]; // G. C. Greubel, May 31 2019
    
  • Mathematica
    LinearRecurrence[{0,3,1}, {1,2,4}, 40] (* G. C. Greubel, May 31 2019 *)
    a[n_,j_,m_]:=Sum[(2^(n+1)Cos[Pi r/(m+1)]^n Cot[Pi r/(2(m+1))] Sin[j Pi r/(m+1)])/(m+1),{r,1,m,2}]
    Table[a[n,3,8],{n,0,40}]//Round (* Herbert Kociemba, Sep 17 2020 *)
    CoefficientList[Series[(1+x)^2/(1-3x^2-x^3),{x,0,50}],x] (* Harvey P. Dale, Jul 16 2021 *)
  • PARI
    a(n)=([0,1,0;0,0,1;1,3,0]^n*[1;2;4])[1,1] \\ Charles R Greathouse IV, Jun 11 2015
    
  • Sage
    ((1+x)^2/(1-3*x^2-x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 31 2019
    

Formula

G.f.: (1+x)^2/(1-3*x^2-x^3).

A215448 a(0)=1, a(1)=0, a(n) = a(n-1) + a(n-2) + Sum_{i=0...n-1} a(i).

Original entry on oeis.org

1, 0, 2, 5, 15, 43, 124, 357, 1028, 2960, 8523, 24541, 70663, 203466, 585857, 1686908, 4857258, 13985917, 40270843, 115955271, 333879896, 961368845, 2768151264, 7970573896, 22950352843, 66082907265, 190278147899, 547884090854, 1577569365297, 4542429947992
Offset: 0

Views

Author

Alex Ratushnyak, Aug 10 2012

Keywords

Comments

For the general recurrence X(n) = 3*X(n-1) - X(n-3) we get Sum_{k=3..n} X(k) = 3*Sum_{k=2..n-1} X(k) - Sum_{k=0..n-3} X(k), which implies the following summation formula: X(n) - X(n-1) - X(n-2) - X(2) + X(1) + X(0) = Sum_{k=2..n-1} X(k). Similarly from the formula X(n) + X(n-3) = 3*X(n-1) we deduce the following relations: Sum_{k=0..2*n-1} X(3*k) = 3*Sum_{k=0..n-1} X(6*k+2), Sum_{k=0..2*n-1} X(3*k+1) = 3*Sum_{k=1..n} X(6*k), and Sum_{k=0..2*n-1} X(3*k+2) = 3*Sum_{k=1..n} X(6*k-2). Lastly from the formula X(n)-X(n-1)=(X(n-1)-X(n-3))+X(n-1) we obtain the relations: Sum_{k=2..2*n+1} (-1)^(k-1)*X(k) = X(2*n) - X(0) + Sum_{k=1..n} X(2*k) and Sum_{k=3..2n} (-1)^k*X(k) = X(2*n-1) - X(1) + Sum_{k=2..n} X(2*k-1). - Roman Witula, Aug 27 2012

Crossrefs

Cf. A052536: same formula, seed {0, 1}, first term removed.
Cf. A122100: same formula, seed {0,-1}, first two terms removed.
Cf. A052545: same formula, seed {1, 1}.

Programs

  • Mathematica
    LinearRecurrence[{3,0,-1},{1,0,2},30] (* Harvey P. Dale, Jan 26 2017 *)
  • Python
    a = [1]*33
    a[1]=0
    sum = a[0]+a[1]
    for n in range(2,33):
        print(a[n-2], end=', ')
        a[n] = a[n-1] + a[n-2] + sum
        sum += a[n]

Formula

a(0)=1, a(1)=0, for n>=2, a(n) = a(n-1) + a(n-2) + (a(0)+...+a(n-1)).
Conjecture: a(n) = +3*a(n-1) -a(n-3) = A076264(n) -3 *A076264(n-1) +2*A076264(n-2). G.f. (2*x-1)*(x-1) / ( 1-3*x+x^3 ). - R. J. Mathar, Aug 11 2012
Proof of the above conjecture: we have a(n) - a(n-1) = a(n-1) + a(n-2) + (a(0) + ... + a(n-1)) - a(n-2) - a(n-3) - (a(0) + ... + a(n-2)), which after simple algebra implies a(n) - a(n-1) = 2*a(n-1) - a(n-3), so the Mathar's formula holds true (see also Witula's comment above). - Roman Witula, Aug 27 2012

A052620 E.g.f. (1-x)^2/(1-3x+x^3).

Original entry on oeis.org

1, 1, 8, 66, 768, 11040, 190800, 3845520, 88583040, 2295578880, 66098592000, 2093556326400, 72337863628800, 2707751497651200, 109153235884492800, 4714413247095552000, 217193790828478464000, 10631538129843671040000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Programs

  • Maple
    spec := [S,{S=Sequence(Prod(Z,Sequence(Z),Union(Z,Sequence(Z))))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);

Formula

E.g.f.: (-1+x)^2/(1-3*x+x^3)
Recurrence: {a(1)=1, a(0)=1, a(2)=8, (n^3+6*n^2+11*n+6)*a(n) +(-3*n-9)*a(n+2) +a(n+3)=0}
Sum(-1/9*(-1+2*_alpha^2-2*_alpha)*_alpha^(-1-n), _alpha=RootOf(1-3*_Z+_Z^3))*n!
a(n) = n!*A052545(n). - R. J. Mathar, Jun 03 2022
Showing 1-3 of 3 results.