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.

A195904 Base-2 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,0,0,0,0.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 65, 130, 260, 520, 1040, 2080, 4161, 8322, 16644, 33288, 66576, 133152, 266305, 532610, 1065220, 2130440, 4260880, 8521760, 17043521, 34087042, 68174084, 136348168, 272696336, 545392672, 1090785345, 2181570690, 4363141380, 8726282760
Offset: 1

Views

Author

Jeremy Gardiner, Sep 25 2011

Keywords

Comments

Here we let p = 6 to produce the above sequence, but p can be an arbitrary natural number. By letting p = 2, 3, 4, 7 we produce A000975, A033138, A083593 and A117302. We denote by U(p,n,m) the number of cases in which the first player is killed in a Russian roulette game when p players use a gun with n chambers and m bullets. They never rotate the cylinder after the game starts. The chambers can be represented by the list {1,2,...,n}.
We are going to calculate the following (0), (1), ..., (t) separately. (0) The first player is killed when one bullet is in the first chamber and the remaining (m-1) bullets are in {2,3,...,n}. We have binomial(n-1,m-1) cases for this. (1) The first is killed when one bullet is in the (p+1)th chamber and the rest of the bullets are in {p+2,..,n}. We have binomial(n-p-1,m-1) cases for this. We continue to calculate and the last is (t), where t = floor((n-m)/p). (t) The first is killed when one bullet is in the (pt+1)-th chamber and the remaining bullets are in {pt+2,...,n}. We have binomial(n-pt-1,m-1) cases for this. Therefore U(p,n,m) = Sum_{z=0..floor((n-m)/p)} binomial(n-pz-1,m-1). Let A(p,n) be the number of cases in which the first player is killed when p players use a gun with n chambers and the number of the bullets can be from 1 to n. Then A(p,n) = Sum_{m=1..n} U(p,n,m). - Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006

Crossrefs

Programs

  • Mathematica
    U[p_, n_, m_, v_]:=Block[{t}, t=Floor[(1+p-m+n-v)/p]; Sum[Binomial[n - v - p*z, m - 1], {z, 0, t - 1}]]; A[p_, n_, v_]:=Sum[U[p, n, k, v], {k, 1, n}]; (* Here we let p = 6 to produce the above sequence, but this code can produce A000975, A033138, A083593, A117302 for p = 2, 3, 4, 7. *) Table[A[6, n, 1], {n, 1, 20}] (* Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006 *)
    Rest[CoefficientList[Series[x/(2*x^7 - x^6 - 2*x + 1), {x, 0, 50}], x]] (* G. C. Greubel, Sep 28 2017 *)
  • PARI
    x='x+O('x^50); Vec(x/(2*x^7 - x^6 - 2*x + 1)) \\ G. C. Greubel, Sep 28 2017

Formula

From Colin Barker, Jun 09 2013: (Start)
a(n) = floor(2^(n+5)/63).
G.f.: x /(2*x^7 - x^6 - 2*x +1).
G.f.: x /((x-1)*(x+1)*(2*x-1)*(x^2-x+1)*( x^2+x+1)). (End)

Extensions

More terms from Colin Barker, Jun 09 2013