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.

User: Julian Zbigniew Kuryllowicz-Kazmierczak

Julian Zbigniew Kuryllowicz-Kazmierczak's wiki page.

Julian Zbigniew Kuryllowicz-Kazmierczak has authored 3 sequences.

A370399 Triangle read by rows: T(n, k) is the denominator of the probability of winning a certain game while playing optimally.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 3, 18, 6, 1, 1, 15, 60, 15, 10, 1, 1, 15, 2, 100, 25, 20, 1, 1, 15, 210, 75, 1050, 105, 35, 1, 1, 15, 5880, 5880, 73500, 29400, 588, 70, 1, 1, 135, 30240, 35280, 529200, 1852200, 15435, 588, 126, 1, 1, 135, 340200, 453600, 7938000, 466754400, 3111696, 1481760, 19845, 252, 1
Offset: 1

Keywords

Comments

T(n, k) is the numerator of the probability of winning a game M(n, k) while playing optimally. The game is played by a single player who begins with n tokens of which k are blue and the rest are red; 0 <= k <= n > 0. Each move consists of randomizing the order of the remaining tokens, observing their resulting order, choosing a number m of tokens to remove, and removing the m tokens that are ordered last; m must be at least 1 but no more than half of the remaining tokens. Play continues until only one token remains; the game is won if that token is blue, otherwise the game is lost.
Let Pr(n,k) be the probability of winning a game M(n,k). Then Pr(n+1,1) = (n/(n-1))*Pr(n,1) if n is a power of 2, Pr(n,1) otherwise. So lim_{n->oo} Pr(n,1) = (1/2)*(2/3)*(4/5)*(8/9)*(16/17)*... = A083864.

Examples

			The values of Pr(n,k) begin as follows:
.
  n\k|  0    1       2       3        4        5       6     7
  ---+---------------------------------------------------------
  1  | 0/1  1/1
  2  | 0/1  1/2     1/1
  3  | 0/1  1/3     2/3     1/1
  4  | 0/1  1/3    11/18    5/6      1/1
  5  | 0/1  4/15   31/60   11/15     9/10     1/1
  6  | 0/1  4/15    1/2    69/100   21/25    19/20    1/1
  7  | 0/1  4/15  101/210  49/75   829/1050  94/105  34/35  1/1
  ...
We can calculate Pr(4,2) using the table below, given the values of Pr(n,k) for n=3 and for n=2. The leftmost column lists each of the six possible results of randomizing the n=4 tokens during the first move; in each randomized sequence, the red and blue tokens are represented by "r" and "b", respectively.
.
  randomized  probability    result if       result if
   sequence       of       last 1 token  last 2 tokens
  of tokens   occurrence     is removed     are removed
  ==========  ===========  ==============  =============
     rrbb         1/6      Pr(3,1) = 1/3   Pr(2,0) = 0/1
     rbrb         1/6      Pr(3,1) = 1/3   Pr(2,1) = 1/2
     brrb         1/6      Pr(3,1) = 1/3   Pr(2,1) = 1/2
     rbbr         1/6      Pr(3,2) = 2/3   Pr(2,1) = 1/2
     brbr         1/6      Pr(3,2) = 2/3   Pr(2,1) = 1/2
     bbrr         1/6      Pr(3,2) = 2/3   Pr(2,2) = 1/1
.
For example, when we get rbrb it's better to remove the last two tokens (one r and one b) instead of removing only the last token (b). So the probability of winning M(4,2) is
Pr(4,2) = (1/6)(1/3) + (1/6)(1/2) + (1/6)(1/2) + (1/6)(2/3) + (1/6)(2/3) + (1/6)(1/1) = 11/18.
Of course Pr(n,k) >= k/n, because k/n could be achieved by removing 1 token on each move.
		

Crossrefs

Numerators are in A370398.

Extensions

More terms from Jon E. Schoenfield, Feb 24 2024

A370398 Triangle read by rows: T(n,k) is the numerator of the probability of winning a 1-player game M(n,k) as defined below while playing optimally.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 11, 5, 1, 0, 4, 31, 11, 9, 1, 0, 4, 1, 69, 21, 19, 1, 0, 4, 101, 49, 829, 94, 34, 1, 0, 4, 2783, 3733, 56069, 25367, 551, 69, 1, 0, 32, 13439, 21517, 389573, 1543163, 14011, 565, 125, 1, 0, 32, 149621, 271643, 5709959, 379562191, 2757715, 1392901, 19388, 251, 1
Offset: 1

Keywords

Comments

A game M(n,k) is played as follows: play begins with k blue tokens and n-k red; 0 <= k <= n > 0. At each move, the order of the r remaining tokens is randomized and observed, and the player then chooses a number d, 1 <= d <= r/2, and discards the last d of the remaining tokens. The game is won iff the last remaining token is blue.
Let Pr(n,k) be the probability of winning a game M(n,k). Then Pr(n+1,1) = (n/(n-1))*Pr(n,1) if n is a power of 2, Pr(n,1) otherwise. So lim_{n->oo} Pr(n,1) = (1/2)*(2/3)*(4/5)*(8/9)*(16/17)*... = A083864.
The (generally suboptimal) strategy of removing 1 token on each move (regardless of the randomization result) provides Pr(n,k) >= k/n as a lower bound.

Examples

			The values of Pr(n,k) begin as follows:
.
  n\k|  0    1       2       3        4        5       6     7
  ---+---------------------------------------------------------
  1  | 0/1  1/1
  2  | 0/1  1/2     1/1
  3  | 0/1  1/3     2/3     1/1
  4  | 0/1  1/3    11/18    5/6      1/1
  5  | 0/1  4/15   31/60   11/15     9/10     1/1
  6  | 0/1  4/15    1/2    69/100   21/25    19/20    1/1
  7  | 0/1  4/15  101/210  49/75   829/1050  94/105  34/35  1/1
  ...
We can calculate Pr(4,2) given the values of Pr(n,k) for n=3 and n=2 as seen in the table below. The leftmost column lists each of the six possible outcomes (i.e., C(4,2) = 6 combinations, all equally likely) of randomizing the n=4 tokens during the first move; in each randomized sequence (i.e., combination), the red and blue tokens are represented by "r" and "b", respectively. Removing the last j = 1 or 2 tokens will leave n' = n - j remaining tokens of which k' = k - f(c,j) are blue. For each randomized sequence, an asterisk marks the probability of winning using the optimal choice of the number j of tokens to remove.
.
  randomized     if remove          if remove       probability
   sequence    last j=1 token    last j=2 tokens      of win
      of       ---------------   ---------------   given optimal
    tokens     n' k' Pr(n',k')   n' k' Pr(n',k')      choice
  ==========   == == =========   == == =========   =============
     rrbb       3  1    1/3 *     2  0    0/1           1/3
     rbrb       3  1    1/3       2  1    1/2 *         1/2
     brrb       3  1    1/3       2  1    1/2 *         1/2
     rbbr       3  2    2/3 *     2  1    1/2           2/3
     brbr       3  2    2/3 *     2  1    1/2           2/3
     bbrr       3  2    2/3       2  2    1/1 *         1/1
.
For example, when we get rbrb it's better to remove the last two tokens (one r and one b) instead of removing only the last token (b).
The probability of winning M(4,2) is the average of the probabilities of winning for each randomized sequence, i.e.,
Pr(4,2) = (1/3 + 1/2 + 1/2 + 2/3 + 2/3 + 1/1)/6 = 11/18.
		

Crossrefs

Denominators are in A370399.
Cf. A083864.

Formula

T(n,k) = numerator(Pr(n,k)) where Pr(n,k) =
0 if k = 0,
1 if k = n, and
(1/C(n,k))*Sum_{c=1..C(n,k)} Max_{j=1..floor(n/2)} Pr(n-j, k-f(c,j)) otherwise,
and where the summation is over all combinations of n tokens, exactly k of which are blue, and f(c,j) is the number of blue tokens among the last j tokens in the c-th combination.

Extensions

More terms from Jon E. Schoenfield, Feb 24 2024

A363245 Lexicographically first sequence of positive integers such that all terms are pairwise coprime and no subset sum is a power of 2.

Original entry on oeis.org

3, 7, 10, 11, 17, 31, 41, 71, 169, 199, 263, 337, 367, 1553, 2129, 2287, 2297, 4351, 10433, 16391, 16433, 34829, 65543, 69557, 165887, 262151, 358481, 817153, 952319, 1048583, 3704737, 3932167, 4518071, 12582919, 17305417, 17367019, 50069497, 50593799, 87228517
Offset: 1

Keywords

Crossrefs

Cf. A353889.

Programs

  • Mathematica
    a = {3}; k = 2; Monitor[Do[While[Or[! Apply[CoprimeQ, Join[a, {k}]], AnyTrue[Map[Log2 @* Total@ Append[#, k] &, Subsets[a]], IntegerQ]], k++]; AppendTo[a, k]; k++, {i, 16}], {i, k}]; a (* Michael De Vlieger, Jun 14 2023 *)
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        a, ss, pows2, m = [], set(), {1, 2}, 2
        for k in count(1):
            if k in pows2: continue
            elif k > m: m <<= 1; pows2.add(m)
            if any(p2-k in ss for p2 in pows2): continue
            if any(gcd(ai, k) != 1 for ai in a): continue
            a.append(k); yield k
            ss |= {k} | {k+si for si in ss if k+si not in ss}
            while m < max(ss): m <<= 1; pows2.add(m)
    print(list(islice(agen(), 30))) # Michael S. Branicky, Jun 09 2023

Extensions

a(23)-a(33) from Michael S. Branicky, Jun 07 2023
a(34)-a(39) from Jon E. Schoenfield, Jun 09 2023