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.

This page as a plain text file.
%I A195904 #25 Apr 14 2021 05:28:12
%S A195904 1,2,4,8,16,32,65,130,260,520,1040,2080,4161,8322,16644,33288,66576,
%T A195904 133152,266305,532610,1065220,2130440,4260880,8521760,17043521,
%U A195904 34087042,68174084,136348168,272696336,545392672,1090785345,2181570690,4363141380,8726282760
%N A195904 Base-2 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,0,0,0,0.
%C A195904 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}.
%C A195904 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
%H A195904 G. C. Greubel, <a href="/A195904/b195904.txt">Table of n, a(n) for n = 1..1000</a>
%H A195904 <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,0,0,0,1,-2).
%F A195904 From _Colin Barker_, Jun 09 2013: (Start)
%F A195904 a(n) = floor(2^(n+5)/63).
%F A195904 G.f.: x /(2*x^7 - x^6 - 2*x +1).
%F A195904 G.f.: x /((x-1)*(x+1)*(2*x-1)*(x^2-x+1)*( x^2+x+1)). (End)
%t A195904 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 *)
%t A195904 Rest[CoefficientList[Series[x/(2*x^7 - x^6 - 2*x + 1), {x, 0, 50}], x]] (* _G. C. Greubel_, Sep 28 2017 *)
%o A195904 (PARI) x='x+O('x^50); Vec(x/(2*x^7 - x^6 - 2*x + 1)) \\ _G. C. Greubel_, Sep 28 2017
%Y A195904 Cf. A000975, A033138, A083593, A117302.
%K A195904 nonn,base,easy
%O A195904 1,2
%A A195904 _Jeremy Gardiner_, Sep 25 2011
%E A195904 More terms from _Colin Barker_, Jun 09 2013