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.

Previous Showing 11-12 of 12 results.

A196382 Number of sequences of n coin flips, that win on the last flip, if the sequence of flips ends with (1,1,0) or (1,0,1).

Original entry on oeis.org

0, 0, 2, 3, 4, 7, 11, 16, 24, 36, 53, 78, 115, 169, 248, 364, 534, 783, 1148, 1683, 2467, 3616, 5300, 7768, 11385, 16686, 24455, 35841, 52528, 76984, 112826, 165355, 242340, 355167, 520523, 762864, 1118032, 1638556, 2401421, 3519454, 5158011
Offset: 1

Views

Author

Paul Weisenhorn, Oct 28 2011

Keywords

Comments

If the sequence ends with (1,1,0) Abel wins; if it ends with (1,0,1) Kain wins.
Abel(n)=A077868(n-3); Kain(n)=A000930(n-3).
Win probability for Abel=sum(Abel(n)/2^n)= 2/3.
Win probability for Kain=sum(Kain(n)/2^n)= 1/3.
Mean length of the game=sum(n*a(n)/2^n)= 6.

Examples

			For n=6 the a(6)=7 solutions are (0,0,0,1,1,0),(1,0,0,1,1,0),(0,0,1,1,1,0),(0,1,1,1,1,0),(1,1,1,1,1,0) for Abel and (0,0,0,1,0,1),(1,0,0,1,0,1) for Kain.
		

References

  • A. Engel, Wahrscheinlichkeit und Statistik, Band 2, Klett, 1978, pages 25-26.

Crossrefs

Cf. A000930, A077868, A179070 (first differences).

Programs

  • Maple
    a(1):=0: a(2):=0: a(3):=2: a(4):=3: a(5):=4:
    for n from 6 to 100 do
      a(n):=a(n-1)+a(n-2)-a(n-5):
    end do:
    seq(a(n),n=1..100);
  • Mathematica
    Rest[CoefficientList[Series[x^3*(2 - x)/((1 - x)*(1 - x - x^3)), {x,0,50}], x]] (* G. C. Greubel, May 02 2017 *)
  • PARI
    x='x+O('x^50); concat([0,0], Vec(x^3*(2 - x)/((1 - x)*(1 - x - x^3)))) \\ G. C. Greubel, May 02 2017

Formula

a(n) = +2*a(n-1) -a(n-2) +a(n-3) -a(n-4), n>=5.
G.f.: x^3*(2-x)/((1-x)*(1-x-x^3)).
a(n) = 2*A077868(n-3) - A077868(n-4). - R. J. Mathar, Jan 11 2017
a(n) = a(n-1) + a(n-3) + 1, n>3. - Greg Dresden, Feb 09 2020

A368299 a(n) is the number of permutations pi of [n] that avoid {231,321} so that pi^4 avoids 132.

Original entry on oeis.org

0, 1, 2, 4, 7, 13, 23, 41, 72, 127, 223, 392, 688, 1208, 2120, 3721, 6530, 11460, 20111, 35293, 61935, 108689, 190736, 334719, 587391, 1030800, 1808928, 3174448, 5570768, 9776017, 17155714, 30106180, 52832663, 92714861, 162703239, 285524281, 501060184, 879299327
Offset: 0

Views

Author

Kassie Archer, Dec 20 2023

Keywords

Comments

Number of compositions of n of the form d_1+d_2+...+d_k=n where d_i is in {1,2,4} if i>1 and d_1 is any positive integer.

Crossrefs

Cf. A000071 (d_i in {1,2}), A077868 (d_i in {1,3}), A274110, A303666.
Partial sums of A181532.

Programs

  • Maple
    a:= proc(n) option remember;
         `if`(n<1, 0, 1+add(a(n-j), j=[1, 2, 4]))
        end:
    seq(a(n), n=0..37);  # Alois P. Heinz, Dec 20 2023
  • Mathematica
    LinearRecurrence[{2,0,-1,1,-1},{0,1,2,4,7},38] (* Stefano Spezia, Dec 21 2023 *)

Formula

G.f.: x/((1-x)*(1-x-x^2-x^4)).
a(n) = Sum_{m=0..n-1} Sum_{r=0..floor(m/4)} Sum_{j=0..floor((m-4*r)/2)} binomial(m-3*r-j,r)*binomial(m-4*r-j,j).
a(n) = 1+a(n-1)+a(n-2)+a(n-4) where a(0)=0, a(1)=1, a(2)=2, a(3)=4.
a(n) = A274110(n+1) - 1.
Previous Showing 11-12 of 12 results.