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.
%I A198442 #75 Mar 15 2023 11:49:19 %S A198442 0,0,2,3,6,8,12,15,20,24,30,35,42,48,56,63,72,80,90,99,110,120,132, %T A198442 143,156,168,182,195,210,224,240,255,272,288,306,323,342,360,380,399, %U A198442 420,440,462,483,506,528,552,575,600,624,650,675,702,728,756,783,812 %N A198442 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,0). %C A198442 If the sequence ends with (1,1,0) Abel wins; if it ends with (1,0,0) Kain wins. %C A198442 Abel(n) = A002620(n-1) = (2*n*(n - 2) + 1 - (-1)^n)/8. %C A198442 Kain(n) = A004526(n-1) = floor((n - 1)/2). %C A198442 Win probability for Abel = sum(Abel(n)/2^n) = 2/3. %C A198442 Win probability for Kain = sum(Kain(n)/2^n) = 1/3. %C A198442 Mean length of the game = sum(n*a(n)/2^n) = 16/3. %C A198442 Essentially the same as A035106. - _R. J. Mathar_, Oct 27 2011 %C A198442 The sequence 2*a(n) is denoted as chi(n) by McKee (1994) and is the degree of the division polynomial f_n as a polynomial in x. He notes that "If x is given weight 1, a is given weight 2, and b is given weight 3, then all the terms in f_n(a, b, x) have weight chi(n)". - _Michael Somos_, Jan 09 2015 %C A198442 In Duistermaat (2010), at the end of section 11.2 The Elliptic Billiard, on page 492 the number of k-periodic fibers counted with multiplicities of the QRT root is given by equation (11.2.8) as "1/4 k^2 + 3{k/2}(1 - {k/2}) - 1 = n^2 - 1 when k = 2n, n^2 + n when k = 2n+1, for every integer k." - _Michael Somos_, Mar 14 2023 %D A198442 J. J. Duistermaat, Discrete Integrable Systems, 2010, Springer Science+Business Media. %D A198442 A. Engel, Wahrscheinlichkeitsrechnung und Statistik, Band 2, Klett, 1978, pages 25-26. %H A198442 Vincenzo Librandi, <a href="/A198442/b198442.txt">Table of n, a(n) for n = 1..10000</a> %H A198442 J. McKee, <a href="http://dx.doi.org/10.2307/2153297">Computing division polynomials</a>, Math. Comp. 63 (1994), 767-771. MR1248973 (95a:11110) %H A198442 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1). %F A198442 a(n) = (2*n^2 - 5 - 3*(-1)^n)/8. %F A198442 a(2*n) = n^2 - 1; a(2*n+1) = n*(n + 1). %F A198442 a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) with n>=4. %F A198442 G.f.: x^3*(2 - x)/((1 + x)*(1 - x)^3). - _R. J. Mathar_, Oct 27 2011 %F A198442 a(n) = a(-n) for all n in Z. a(0) = -1. - _Michael Somos_, Jan 09 2015 %F A198442 0 = a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(-1 - a(n+1) + a(n+2)) for all n in Z. - _Michael Somos_, Jan 09 2015 %F A198442 1 = a(n) - a(n+1) - a(n+2) + a(n+3), 2 = a(n) - 2*a(n+2) + a(n+4) for all n in Z. - _Michael Somos_, Jan 09 2015 %F A198442 a(n) = A002620(n+2) - A052928(n+2) for n >= 1. (Note A265611(n) = A002620(n+1) + A052928(n+1) for n >= 1.) - _Peter Luschny_, Dec 22 2015 %F A198442 a(n+1) = A110654(n)^2 + A110654(n)*(2 - (n mod 2)), n >= 0. - _Fred Daniel Kline_, Jun 08 2016 %F A198442 a(n) = A004526(n)*A004526(n+3). - _Fred Daniel Kline_, Aug 04 2016 %F A198442 a(n) = floor((n^2 - 1)/4). - _Bruno Berselli_, Mar 15 2021 %e A198442 For n = 6 the a(6) = 8 solutions are (0,0,0,1,1,0), (0,1,0,1,1,0),(0,0,1,1,1,0), (1,0,1,1,1,0), (0,1,1,1,1,0),(1,1,1,1,1,0) for Abel and %e A198442 (0,0,0,1,0,0), (0,1,0,1,0,0) for Kain. %e A198442 G.f. = 2*x^3 + 3*x^4 + 6*x^5 + 8*x^6 + 12*x^7 + 15*x^8 + 20*x^9 + ... %p A198442 for n from 1 by 2 to 99 do %p A198442 a(n):=(n^2-1)/4: %p A198442 a(n+1):=(n+1)^2/4-1: %p A198442 end do: %p A198442 seq(a(n),n=1..100); %t A198442 a[ n_] := Quotient[ n^2 - 1, 4]; (* _Michael Somos_, Jan 09 2015 *) %o A198442 (Perl) sub a { %o A198442 my ($t, $n) = (0, shift); %o A198442 for (0..((1<<$n)-1)) { %o A198442 my $str = substr unpack("B32", pack("N", $_)), -$n; %o A198442 $t++ if ($str =~ /1.0$/ and not $str =~ /1.0./); %o A198442 } %o A198442 return $t %o A198442 } # _Charles R Greathouse IV_, Oct 26 2011 %o A198442 (PARI) a(n)=([1,1,0,0,0,0;0,0,1,1,0,0;0,1,0,0,1,0;0,0,0,1,1,0;0,0,0,0,0,2;0,0,0,0,0,2]^n)[1,5] \\ _Charles R Greathouse IV_, Oct 26 2011 %o A198442 (PARI) {a(n) = (n^2 - 1) \ 4}; /* _Michael Somos_, Jan 09 2015 */ %o A198442 (Magma) [(2*n^2-5-3*(-1)^n)/8: n in [1..60]]; // _Vincenzo Librandi_, Oct 28 2011 %o A198442 (Sage) %o A198442 def A198442(): %o A198442 yield 0 %o A198442 x, y = 0, 2 %o A198442 while True: %o A198442 yield x %o A198442 x, y = x + y, x//y + 1 %o A198442 a = A198442(); print([next(a) for i in range(57)]) # _Peter Luschny_, Dec 22 2015 %Y A198442 Cf. A000004, A002620, A004526, A004652, A005843, A008585, A008586, A023443, A028242, A047221, A047336, A052928, A242477, A265611. %Y A198442 Cf. A035106, A079524, A238377. %K A198442 nonn,easy %O A198442 1,3 %A A198442 _Paul Weisenhorn_, Oct 25 2011 %E A198442 a(12) inserted by _Charles R Greathouse IV_, Oct 26 2011