login
a(n) is the numerator of the ratio of winning probabilities P_A/P_B of winning in a 2-player game with a ratio of odds for A and B in a single round of 2:1. To win the game it is necessary to win n rounds in a row.
6

%I #26 Mar 13 2024 09:11:38

%S 2,16,104,128,3872,3328,139904,167936,5038592,2748416,7886848,2392064,

%T 6530342912,39182073856,235092475904,16594763776,8463329656832,

%U 381804347392,304679869743104,6647560798208,10968475319140352,2861341387784192,8401385351544832,5207012459675648

%N a(n) is the numerator of the ratio of winning probabilities P_A/P_B of winning in a 2-player game with a ratio of odds for A and B in a single round of 2:1. To win the game it is necessary to win n rounds in a row.

%C Such a game can be implemented, for instance, by rolling a single die per round, with A winning the round if the numbers are 1 to 4 and B winning if the numbers are 5 and 6.

%H Paolo Xausa, <a href="/A370823/b370823.txt">Table of n, a(n) for n = 1..1000</a>

%H IBM Research, <a href="https://research.ibm.com/haifa/ponderthis/challenges/February2024.html">A Dice Game</a>, Ponder This Challenge, February 2024.

%F See the solution page of the "Ponder This" challenge for the formula derived from the Markov matrix representing the rules of the game.

%F Numerator of 2^(n-1)*(3^n-1)/(3^n-2^n). - _Chai Wah Wu_, Mar 07 2024

%e a(n)/A370824(n) for n = 1..11: 2/1, 16/5, 104/19, 128/13, 3872/211, 3328/95, 139904/2059, 167936/1261, 5038592/19171, 2748416/5275, 7886848/7613.

%t Array[Numerator[(3^#-1)/((3/2)^#-1)/2] &, 35] (* _Paolo Xausa_, Mar 13 2024 *)

%o (PARI) a370823_4(n, A=2/3, B=1/3) = my (an=A^n, bn=B^n); (1-A) * an * (1-bn) / ((1-B) * bn * (1-an));

%o \\ or by determination of the eigenvalues of the Markov matrix

%o a370823_4(n, na=2, nb=1) = { if (n==1, na/nb, my (ntot=na+nb, A=na/ntot, B=nb/ntot, M=matrix(2*n+1)); M[1,2]=A; M[1,3]=B; for (rp=1, n-1, my (rb=2*rp+1, ra=rb-1); M[ra,3]=B; M[rb,2]=A; M[ra,ra+2]=A; M[rb,rb+2]=B); M[2*n,2*n]=M[2*n+1,2*n+1]=1; my (ME=mateigen(M)); ME[1,2]/ME[1,3])};

%o numerator(a370823_4(n))

%o (Python)

%o from math import gcd

%o def A370823(n): return (a:=3**n-1<<n-1)//gcd(a,3**n-(1<<n)) # _Chai Wah Wu_, Mar 07 2024

%Y A370824 are the corresponding denominators.

%K nonn,frac

%O 1,1

%A _Hugo Pfoertner_, Mar 02 2024