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.

A171861 Expansion of x*(1+x+x^2) / ( (x-1)*(x^3+x^2-1) ).

This page as a plain text file.
%I A171861 #28 Oct 12 2017 15:47:18
%S A171861 1,2,4,6,9,13,18,25,34,46,62,83,111,148,197,262,348,462,613,813,1078,
%T A171861 1429,1894,2510,3326,4407,5839,7736,10249,13578,17988,23830,31569,
%U A171861 41821,55402,73393,97226,128798,170622,226027,299423,396652,525453,696078,922108
%N A171861 Expansion of x*(1+x+x^2) / ( (x-1)*(x^3+x^2-1) ).
%C A171861 Number of wins in Penney's game if the two players start HHT and TTT and HHT beats TTT.
%C A171861 HHT beats TTT 70% of the time. - _Geoffrey Critzer_, Mar 01 2014
%H A171861 G. C. Greubel, <a href="/A171861/b171861.txt">Table of n, a(n) for n = 1..1000</a>
%H A171861 Wikipedia, <a href="http://en.wikipedia.org/wiki/Penney&#39;s_game">Penney's game</a>
%H A171861 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,0,-1).
%F A171861 a(n) = a(n-1) +a(n-2) -a(n-4) = A000931(n+10)-3 = A134816(n+6)-3 = A078027(n+12)-3.
%F A171861 a(n) = A164315(n-1). - _Alois P. Heinz_, Oct 12 2017
%e A171861 a(n) enumerates length n+2 sequences on {H,T} that end in HHT but do not contain the contiguous subsequence TTT.
%e A171861 a(3)=4 because we have: TTHHT, THHHT, HTHHT, HHHHT.
%e A171861 a(4)=6 because we have: TTHHHT, THTHHT, THHHHT, HTTHHT, HTHHHT, HHHHHT. - _Geoffrey Critzer_, Mar 01 2014
%p A171861 A171861 := proc(n) option remember; if n <=4 then op(n,[1,2,4,6]); else procname(n-1)+procname(n-2)-procname(n-4) ; end if; end proc:
%t A171861 nn=44;CoefficientList[Series[x(1+x+x^2)/(1-x-x^2+x^4),{x,0,nn}],x] (* _Geoffrey Critzer_, Mar 01 2014 *)
%o A171861 (PARI) a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,0,1,1]^(n-1)*[1;2;4;6])[1,1] \\ _Charles R Greathouse IV_, Oct 03 2016
%Y A171861 Related sequences are A000045 (HHH beats HHT, HTT beats TTH), A006498 (HHH beats HTH), A023434 (HHH beats HTT), A000930 (HHH beats THT, HTH beats HHT), A000931 (HHH beats TTH), A077868 (HHT beats HTH), A002620 (HHT beats HTT), A000012 (HHT beats THH), A004277 (HHT beats THT), A070550 (HTH beats HHH), A000027 (HTH beats HTT), A097333 (HTH beats THH), A040000 (HTH beats TTH), A068921 (HTH beats TTT), A054405 (HTT beats HHH), A008619 (HTT beats HHT), A038718 (HTT beats THT), A128588 (HTT beats TTT).
%Y A171861 Cf. A164315 (essentially the same sequence).
%K A171861 easy,nonn
%O A171861 1,2
%A A171861 _Ed Pegg Jr_, Oct 16 2010