{
  "index": "2006-A-2",
  "type": "COMB",
  "tag": [
    "COMB",
    "NT"
  ],
  "difficulty": "",
  "question": "Alice and Bob play a game in which they take turns removing stones from\na heap that initially has $n$ stones. The number of stones removed at\neach turn must be one less than a prime number. The winner is the player\nwho takes the last stone. Alice plays first. Prove that there are\ninfinitely many $n$ such that Bob has a winning strategy.\n(For example, if $n=17$, then Alice might take 6 leaving 11; then\nBob might take 1 leaving 10; then Alice can take the remaining stones\nto win.)",
  "solution": "Suppose on the contrary that the set $B$ of values of $n$ for which Bob\nhas a winning strategy is finite; for convenience, we include $n=0$ in $B$,\nand write $B = \\{b_1, \\dots, b_m\\}$.\nThen for every nonnegative integer $n$ not\nin $B$, Alice must have some move on a heap of $n$ stones leading to a\nposition in which the second player wins. That is, every nonnegative integer\nnot in $B$ can be written as $b + p - 1$ for some $b \\in B$ and some prime\n$p$. However, there are numerous ways to show that this cannot happen.\n\n\\textbf{First solution:}\nLet $t$ be any integer bigger than all of the $b \\in B$. Then it is easy to\nwrite down $t$ consecutive composite integers, e.g., $(t+1)! + 2, \\dots,\n(t+1)! + t+1$. Take $n = (t+1)! + t$; then for each $b \\in B$,\n$n - b + 1$ is one of the composite integers we just wrote down.\n\n\\textbf{Second solution:}\nLet $p_1, \\dots, p_{2m}$ be\nany prime numbers; then by the Chinese remainder theorem, there exists a\npositive integer $x$ such that\n\\begin{align*}\nx - b_1 &\\equiv -1 \\pmod{p_1 p_{m+1}} \\\\\n\\dots \\\\\nx - b_n &\\equiv -1 \\pmod{p_m p_{2m}}.\n\\end{align*}\nFor each $b \\in B$,\nthe unique integer $p$ such that $x=b+p-1$ is divisible\nby at least two primes, and so cannot itself be prime.\n\n\\textbf{Third solution:} (by Catalin Zara)\nPut $b_1 = 0$, and take $n = (b_2 - 1)\\cdots(b_m - 1)$; then $n$ is\ncomposite because $3, 8 \\in B$, and for any nonzero $b \\in B$,\n$n - b_i + 1$ is divisible by but not equal to $b_i - 1$.\n(One could also take $n = b_2 \\cdots b_m - 1$, so that\n$n-b_i+1$ is divisible by $b_i$.)",
  "vars": [
    "n",
    "b",
    "b_1",
    "b_2",
    "b_i",
    "b_m",
    "b_n",
    "p",
    "p_1",
    "p_m+1",
    "p_2m",
    "x",
    "t"
  ],
  "params": [
    "B",
    "m"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "heapcount",
        "b": "bobvalue",
        "b_1": "bobvalone",
        "b_2": "bobvaltwo",
        "b_i": "bobvali",
        "b_m": "bobvalmax",
        "b_n": "bobvaln",
        "p": "primevar",
        "p_1": "primeone",
        "p_m+1": "primeplus",
        "p_2m": "primedouble",
        "x": "chinesex",
        "t": "lengthblock",
        "B": "bobset",
        "m": "setsize"
      },
      "question": "Alice and Bob play a game in which they take turns removing stones from\na heap that initially has $heapcount$ stones. The number of stones removed at\neach turn must be one less than a prime number. The winner is the player\nwho takes the last stone. Alice plays first. Prove that there are\ninfinitely many $heapcount$ such that Bob has a winning strategy.\n(For example, if $heapcount=17$, then Alice might take 6 leaving 11; then\nBob might take 1 leaving 10; then Alice can take the remaining stones\nto win.)",
      "solution": "Suppose on the contrary that the set $bobset$ of values of $heapcount$ for which Bob\nhas a winning strategy is finite; for convenience, we include $heapcount=0$ in $bobset$,\nand write $bobset = \\{bobvalone, \\dots, bobvalmax\\}.\nThen for every nonnegative integer $heapcount$ not\nin $bobset$, Alice must have some move on a heap of $heapcount$ stones leading to a\nposition in which the second player wins. That is, every nonnegative integer\nnot in $bobset$ can be written as $bobvalue + primevar - 1$ for some $bobvalue \\in bobset$ and some prime\n$primevar$. However, there are numerous ways to show that this cannot happen.\n\n\\textbf{First solution:}\nLet $lengthblock$ be any integer bigger than all of the $bobvalue \\in bobset$. Then it is easy to\nwrite down $lengthblock$ consecutive composite integers, e.g., $(lengthblock+1)! + 2, \\dots,\n(lengthblock+1)! + lengthblock+1$. Take $heapcount = (lengthblock+1)! + lengthblock$; then for each $bobvalue \\in bobset$,\n$heapcount - bobvalue + 1$ is one of the composite integers we just wrote down.\n\n\\textbf{Second solution:}\nLet $primeone, \\dots, primedouble$ be\nany prime numbers; then by the Chinese remainder theorem, there exists a\npositive integer $chinesex$ such that\n\\begin{align*}\nchinesex - bobvalone &\\equiv -1 \\pmod{primeone \\, primeplus} \\\\\n\\dots \\\\\nchinesex - bobvaln &\\equiv -1 \\pmod{p_{setsize} \\, primedouble}.\n\\end{align*}\nFor each $bobvalue \\in bobset$,\nthe unique integer $primevar$ such that $chinesex=bobvalue+primevar-1$ is divisible\nby at least two primes, and so cannot itself be prime.\n\n\\textbf{Third solution:} (by Catalin Zara)\nPut $bobvalone = 0$, and take $heapcount = (bobvaltwo - 1)\\cdots(bobvalmax - 1)$; then $heapcount$ is\ncomposite because $3, 8 \\in bobset$, and for any nonzero $bobvalue \\in bobset$,\n$heapcount - bobvali + 1$ is divisible by but not equal to $bobvali - 1$.\n(One could also take $heapcount = bobvaltwo \\cdots bobvalmax - 1$, so that\n$heapcount-bobvali+1$ is divisible by $bobvali$.)"
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "marblebox",
        "b": "lanterns",
        "b_1": "sunflower",
        "b_2": "moonshard",
        "b_i": "stargazer",
        "b_m": "cloudrealm",
        "b_n": "riverstone",
        "p": "quartzine",
        "p_1": "amberglow",
        "p_m+1": "opalcrest",
        "p_2m": "ivoryflare",
        "x": "copperveil",
        "t": "silktrail",
        "B": "voyagehub",
        "m": "harborline"
      },
      "question": "Alice and Bob play a game in which they take turns removing stones from\na heap that initially has $marblebox$ stones. The number of stones removed at\neach turn must be one less than a prime number. The winner is the player\nwho takes the last stone. Alice plays first. Prove that there are\ninfinitely many $marblebox$ such that Bob has a winning strategy.\n(For example, if $marblebox=17$, then Alice might take 6 leaving 11; then\nBob might take 1 leaving 10; then Alice can take the remaining stones\nto win.)",
      "solution": "Suppose on the contrary that the set $voyagehub$ of values of $marblebox$ for which Bob\nhas a winning strategy is finite; for convenience, we include $marblebox=0$ in $voyagehub$,\nand write $voyagehub = \\{sunflower, \\dots, cloudrealm\\}$.\nThen for every nonnegative integer $marblebox$ not\nin $voyagehub$, Alice must have some move on a heap of $marblebox$ stones leading to a\nposition in which the second player wins. That is, every nonnegative integer\nnot in $voyagehub$ can be written as $lanterns + quartzine - 1$ for some $lanterns \\in voyagehub$ and some prime\n$quartzine$. However, there are numerous ways to show that this cannot happen.\n\n\\textbf{First solution:}\nLet $silktrail$ be any integer bigger than all of the $lanterns \\in voyagehub$. Then it is easy to\nwrite down $silktrail$ consecutive composite integers, e.g., $(silktrail+1)! + 2, \\dots,\n(silktrail+1)! + silktrail+1$. Take $marblebox = (silktrail+1)! + silktrail$; then for each $lanterns \\in voyagehub$,\n$marblebox - lanterns + 1$ is one of the composite integers we just wrote down.\n\n\\textbf{Second solution:}\nLet $amberglow, \\dots, ivoryflare$ be\nany prime numbers; then by the Chinese remainder theorem, there exists a\npositive integer $copperveil$ such that\n\\begin{align*}\ncopperveil - sunflower &\\equiv -1 \\pmod{amberglow\\, opalcrest} \\\\\n\\dots \\\\\ncopperveil - riverstone &\\equiv -1 \\pmod{p_{harborline}\\, ivoryflare}.\n\\end{align*}\nFor each $lanterns \\in voyagehub$,\nthe unique integer $quartzine$ such that $copperveil=lanterns+quartzine-1$ is divisible\nby at least two primes, and so cannot itself be prime.\n\n\\textbf{Third solution:} (by Catalin Zara)\nPut $sunflower = 0$, and take $marblebox = (moonshard - 1)\\cdots(cloudrealm - 1)$; then $marblebox$ is\ncomposite because $3, 8 \\in voyagehub$, and for any nonzero $lanterns \\in voyagehub$,\n$marblebox - stargazer + 1$ is divisible by but not equal to $stargazer - 1$.\n(One could also take $marblebox = moonshard \\cdots cloudrealm - 1$, so that\n$marblebox-lanterns+1$ is divisible by $lanterns$.)"
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "boundless",
        "b": "misfortune",
        "b_1": "ultimate",
        "b_2": "penultimate",
        "b_i": "specific",
        "b_m": "primordial",
        "b_n": "unchanging",
        "p": "composite",
        "p_1": "nonprimal",
        "p_m+1": "nonprimalnext",
        "p_2m": "nonprimaldouble",
        "x": "voidness",
        "t": "minuscule",
        "B": "loserset",
        "m": "scarcity"
      },
      "question": "Alice and Bob play a game in which they take turns removing stones from\na heap that initially has $boundless$ stones. The number of stones removed at\neach turn must be one less than a prime number. The winner is the player\nwho takes the last stone. Alice plays first. Prove that there are\ninfinitely many $boundless$ such that Bob has a winning strategy.\n(For example, if $boundless=17$, then Alice might take 6 leaving 11; then\nBob might take 1 leaving 10; then Alice can take the remaining stones\nto win.)",
      "solution": "Suppose on the contrary that the set $loserset$ of values of $boundless$ for which Bob\nhas a winning strategy is finite; for convenience, we include $boundless=0$ in $loserset$,\nand write $loserset = \\{ultimate, \\dots, primordial\\}$.\nThen for every nonnegative integer $boundless$ not\nin $loserset$, Alice must have some move on a heap of $boundless$ stones leading to a\nposition in which the second player wins. That is, every nonnegative integer\nnot in $loserset$ can be written as $misfortune + composite - 1$ for some $misfortune \\in loserset$ and some prime $composite$. However, there are numerous ways to show that this cannot happen.\n\n\\textbf{First solution:}\nLet $minuscule$ be any integer bigger than all of the $misfortune \\in loserset$. Then it is easy to\nwrite down $minuscule$ consecutive composite integers, e.g., $(minuscule+1)! + 2, \\dots,\n(minuscule+1)! + minuscule+1$. Take $boundless = (minuscule+1)! + minuscule$; then for each $misfortune \\in loserset$,\n$boundless - misfortune + 1$ is one of the composite integers we just wrote down.\n\n\\textbf{Second solution:}\nLet $nonprimal, \\dots, nonprimaldouble$ be\nany prime numbers; then by the Chinese remainder theorem, there exists a\npositive integer $voidness$ such that\n\\begin{align*}\nvoidness - ultimate &\\equiv -1 \\pmod{nonprimal\\, nonprimalnext} \\\\\n\\dots \\\\\nvoidness - primordial &\\equiv -1 \\pmod{nonprimal\\, nonprimaldouble}.\n\\end{align*}\nFor each $misfortune \\in loserset$,\nthe unique integer $composite$ such that $voidness=misfortune+composite-1$ is divisible\nby at least two primes, and so cannot itself be prime.\n\n\\textbf{Third solution:} (by Catalin Zara)\nPut $ultimate = 0$, and take $boundless = (penultimate - 1)\\cdots(primordial - 1)$; then $boundless$ is\ncomposite because $3, 8 \\in loserset$, and for any nonzero $misfortune \\in loserset$,\n$boundless - specific + 1$ is divisible by but not equal to $specific - 1$.\n(One could also take $boundless = penultimate \\cdots primordial - 1$, so that\n$boundless-specific+1$ is divisible by $specific$.)"
    },
    "garbled_string": {
      "map": {
        "n": "zxqplmnae",
        "b": "hqrvxsnpt",
        "b_1": "jakdvntle",
        "b_2": "qlmshzrpa",
        "b_i": "sfkptuqar",
        "b_m": "wvcdjkyua",
        "b_n": "mgztralpe",
        "p": "txqrdvose",
        "p_1": "klmzgfhpe",
        "p_m+1": "nvtrsjqae",
        "p_2m": "gqtdlzxea",
        "x": "zbqmrktla",
        "t": "ylksdprma",
        "B": "vxhntcosa",
        "m": "qsldpnria"
      },
      "question": "Alice and Bob play a game in which they take turns removing stones from\na heap that initially has $zxqplmnae$ stones. The number of stones removed at\neach turn must be one less than a prime number. The winner is the player\nwho takes the last stone. Alice plays first. Prove that there are\ninfinitely many $zxqplmnae$ such that Bob has a winning strategy.\n(For example, if $zxqplmnae=17$, then Alice might take 6 leaving 11; then\nBob might take 1 leaving 10; then Alice can take the remaining stones\nto win.)",
      "solution": "Suppose on the contrary that the set $vxhntcosa$ of values of $zxqplmnae$ for which Bob\nhas a winning strategy is finite; for convenience, we include $zxqplmnae=0$ in $vxhntcosa$,\nand write $vxhntcosa = \\{jakdvntle, \\dots, wvcdjkyua\\}.\nThen for every nonnegative integer $zxqplmnae$ not\nin $vxhntcosa$, Alice must have some move on a heap of $zxqplmnae$ stones leading to a\nposition in which the second player wins. That is, every nonnegative integer\nnot in $vxhntcosa$ can be written as $hqrvxsnpt + txqrdvose - 1$ for some $hqrvxsnpt \\in vxhntcosa$ and some prime\n$txqrdvose$. However, there are numerous ways to show that this cannot happen.\n\n\\textbf{First solution:}\nLet $ylksdprma$ be any integer bigger than all of the $hqrvxsnpt \\in vxhntcosa$. Then it is easy to\nwrite down $ylksdprma$ consecutive composite integers, e.g., $(ylksdprma+1)! + 2, \\dots,\n(ylksdprma+1)! + ylksdprma+1$. Take $zxqplmnae = (ylksdprma+1)! + ylksdprma$; then for each $hqrvxsnpt \\in vxhntcosa$,\n$zxqplmnae - hqrvxsnpt + 1$ is one of the composite integers we just wrote down.\n\n\\textbf{Second solution:}\nLet $klmzgfhpe, \\dots, gqtdlzxea$ be\nany prime numbers; then by the Chinese remainder theorem, there exists a\npositive integer $zbqmrktla$ such that\n\\begin{align*}\nzbqmrktla - jakdvntle &\\equiv -1 \\pmod{klmzgfhpe \\, nvtrsjqae} \\\\\n\\dots \\\\\nzbqmrktla - mgztralpe &\\equiv -1 \\pmod{txqrdvose_{qsldpnria} \\, gqtdlzxea}.\n\\end{align*}\nFor each $hqrvxsnpt \\in vxhntcosa$,\nthe unique integer $txqrdvose$ such that $zbqmrktla=hqrvxsnpt+txqrdvose-1$ is divisible\nby at least two primes, and so cannot itself be prime.\n\n\\textbf{Third solution:} (by Catalin Zara)\nPut $jakdvntle = 0$, and take $zxqplmnae = (qlmshzrpa - 1)\\cdots(wvcdjkyua - 1)$; then $zxqplmnae$ is\ncomposite because $3, 8 \\in vxhntcosa$, and for any nonzero $hqrvxsnpt \\in vxhntcosa$,\n$zxqplmnae - sfkptuqar + 1$ is divisible by but not equal to $sfkptuqar - 1$.\n(One could also take $zxqplmnae = qlmshzrpa \\cdots wvcdjkyua - 1$, so that\n$zxqplmnae-sfkptuqar+1$ is divisible by $sfkptuqar$.)"
    },
    "kernel_variant": {
      "question": "Let a single heap initially contain $n\\ge 0$ stones.  \nOn every turn the player whose move it is must choose  \n\n$\\;$• a prime number $p$ (the choice $p=2$ is permitted), and  \n$\\;$• an integer exponent $k\\ge 2$\n\nand then remove exactly  \n\\[\nm=p^{\\,k}-1\n\\]\nstones from the heap.  \nThe legal subtraction set is therefore  \n\\[\n\\mathcal L=\\{\\,p^{k}-1:\\;p\\text{ prime},\\;k\\ge 2\\}\n           =\\{3,7,8,15,24,26,31,48,\\dots\\}.\n\\]\n(Observe that $1,2\\not\\in\\mathcal L$.)\n\nNormal play is used (the player making the last move wins) and Alice\nmoves first.\n\na)  Prove that there exist infinitely many initial heap sizes $n$ for\nwhich Bob (the second player) has a winning strategy.\n\nb)  Prove the much stronger fact that there are infinitely many\n\\emph{consecutive} starting sizes that are losing for Alice; that is,\nshow that there exist infinitely many integers $N$ for which Bob wins\nfrom \\emph{both} $N$ and $N+1$.",
      "solution": "We use standard Sprague–Grundy terminology.  \nA position is a $\\mathcal P$–position if the previous player can force\na win, and an $\\mathcal N$–position otherwise.\nEquivalently,\n\n$\\;$• a position is $\\mathcal N$ iff it has at least one option that is\n   $\\mathcal P$,  \n\n$\\;$• a position is $\\mathcal P$ iff \\emph{all} of its options are\n   $\\mathcal N$.  \n\nLet $\\mathcal P$ denote the set of $\\mathcal P$–positions and write\n$a\\equiv b\\pmod m$ as $a\\stackrel{m}{\\equiv}b$.\nFor a finite set $F\\subset\\mathbb N$ put $\\widehat F=\\max F$.\n\n--------------------------------------------------------------------\n0.  Three trivial $\\mathcal P$–positions\n--------------------------------------------------------------------\nThe numbers $0,1,2$ admit no legal move, hence belong to $\\mathcal P$.\n\n--------------------------------------------------------------------\n1.  A basic observation about the move set\n--------------------------------------------------------------------\n(★)  If a positive integer $x$ is divisible by two distinct primes, then\n$x$ is \\emph{not} a prime power.\nConsequently, if $y+1$ is divisible by two distinct primes, then\n$y\\not\\in\\mathcal L$.\n\n--------------------------------------------------------------------\n2.  Infinitely many $\\mathcal P$–positions (part a)\n--------------------------------------------------------------------\nAssume for contradiction that\n\\[\n\\mathcal P=\\{e_1,\\dots ,e_t\\},\\qquad\n0=e_1<e_2<\\dots<e_t .\n\\]\nChoose pairwise distinct primes\n$q_1,\\dots ,q_t,r_1,\\dots ,r_t$ with every $q_i,r_i>\\!e_t$.\nBy the Chinese Remainder Theorem (CRT) there exists $X$ such that  \n\\[\nX\\stackrel{q_i r_i}{\\equiv}e_i-1\\qquad(1\\le i\\le t),\n\\]\nand we set  \n\\[\nN:=X+2\\!\\!\\prod_{i=1}^{t}q_i r_i .\n\\]\nFor each $i$ we then have\n$N-e_i+1\\stackrel{q_i r_i}{\\equiv}0$, so $N-e_i+1$ is divisible by\n$q_i$ and $r_i$ and is therefore not a prime power.\nThus $N-e_i\\not\\in\\mathcal L$ for every $i$, i.e.\\ $N$ has no move to\nany $e_i$.\nAll other options are $\\mathcal N$ by definition, whence $N$ itself is\n$\\mathcal P$, contradicting finiteness of $\\mathcal P$.\nTherefore $\\mathcal P$ is infinite, proving (a). ∎\n\n\n\n--------------------------------------------------------------------\n3.  A strengthened blocking lemma\n--------------------------------------------------------------------\nLemma 1 (strong double blockade).  \nLet $F\\subset\\mathbb N$ be finite.\nThen there exists a pair of consecutive integers\n\\[\n(M,M+1),\\qquad M>\\widehat F,\n\\]\nsuch that neither $M$ nor $M+1$ has a legal move that ends in $F$.\n\nProof.  \nAssign to every $e\\in F$ four fresh primes\n$q_e,r_e,s_e,t_e$, all $>\\widehat F$ and pairwise distinct.\nBy the CRT choose $X$ obeying\n\\[\nX\\stackrel{q_e r_e}{\\equiv}e-1,\\qquad\nX\\stackrel{s_e t_e}{\\equiv}e-2\\qquad(e\\in F),\n\\]\nand set  \n\\[\nM:=X+2\\!\\!\\prod_{e\\in F}q_e r_e s_e t_e .\n\\]\nExactly as in Section 2, for each $e\\in F$ both $M-e$ and\n$(M+1)-e$ fail to lie in $\\mathcal L$, so the claim holds. ∎\n\n\n\n--------------------------------------------------------------------\n4.  Consecutive $\\mathcal P$–pairs (part b)\n--------------------------------------------------------------------\nWe build an infinite strictly increasing sequence\n\\[\nN_1<N_2<N_3<\\dots\n\\]\nsuch that every pair $(N_j,N_j+1)$ consists of $\\mathcal P$–positions.\n\n----------------------------------------------------------------\n4.1  Preparation\n----------------------------------------------------------------\nLet $S_{0}:=\\{0,1,2\\}$.\nFor $j\\ge 1$ we shall maintain a finite set $S_{j-1}$ which already\n\\emph{contains every} $\\mathcal P$–position not exceeding\n$\\widehat{S_{j-1}}$.\n\n----------------------------------------------------------------\n4.2  Inductive construction\n----------------------------------------------------------------\nAssume $S_{j-1}$ is available.\n\nStep 1. First try.  \nApply Lemma 1 with $F=S_{j-1}$, obtaining a pair\n\\[\n(M,M+1),\\qquad M>\\widehat{S_{j-1}},\n\\]\nthat cannot move into $S_{j-1}$.\n\nIf \\emph{both} $M$ and $M+1$ are $\\mathcal P$ we set\n\\[\nN_j:=M,\\qquad\nS_j:=S_{j-1}\\cup\\{M,M+1\\},\n\\]\nand proceed to the next index.\n\nOtherwise at least one of $M,M+1$ is $\\mathcal N$.  Let\n\\[\nT:=\\{e\\le M+1 : e\\text{ is }\\mathcal P\\},\\qquad\nF':=S_{j-1}\\cup T .\n\\]\nThe set $F'$ equals \\emph{all} $\\mathcal P$–positions not exceeding\n$M+1$, hence it is finite and satisfies\n\\[\n\\widehat{S_{j-1}}\\;<\\;\\widehat{F'}\\;\\le\\;M+1. \\tag{1}\n\\]\n\nStep 2. Further tries.  \nInvoke Lemma 1 with $F'$; let the resulting pair be $(M',M'+1)$.\nBecause $M'>\\widehat{F'}$ and by (1) we also have $M'>M+1$.\nIf both $M',M'+1$ are $\\mathcal P$ we record\n\\[\nN_j:=M',\\qquad\nS_j:=F'\\cup\\{M',M'+1\\}\n\\]\nand stop the inductive step.\nIf not, enlarge $F'$ by all $\\mathcal P$–positions up to $M'+1$ and\nrepeat Lemma 1.\nAs $\\widehat{F'}$ strictly increases each time, the process is\nwell defined.\n\n----------------------------------------------------------------\n4.3  Termination of the process\n----------------------------------------------------------------\nSuppose, for a contradiction, that in the $j^{\\text{th}}$ induction\nstage the repeated application of Lemma 1 never produces a pair of\nconsecutive $\\mathcal P$–positions.\nThis yields an unbounded sequence\n\\[\nM^{(1)}<M^{(2)}<M^{(3)}<\\dots\n\\]\nsuch that, for every $\\nu$,\n\n$\\;$• $F_\\nu$ (the set fed into the $\\nu^{\\text{th}}$ call of Lemma 1)\nequals \\emph{all} $\\mathcal P$–positions $\\le M^{(\\nu)}+1$,  \n\n$\\;$• both $M^{(\\nu)}$ and $M^{(\\nu)}+1$ have no move into $F_\\nu$.\n\nBecause the sequence $(M^{(\\nu)})$ is unbounded, every $\\mathcal P$\neventually belongs to some $F_\\nu$.\nHence for each $\\nu$ the numbers $M^{(\\nu)}$ and $M^{(\\nu)}+1$ possess\n\\emph{no} legal move to a lower $\\mathcal P$–position.\nAn $\\mathcal N$–position must have at least one such move, so\nboth $M^{(\\nu)}$ and $M^{(\\nu)}+1$ are forced to be $\\mathcal P$,\ncontradicting the assumption that no consecutive $\\mathcal P$–pair is\never produced.\nTherefore the procedure terminates after finitely many attempts at\nevery stage $j$.\n\n----------------------------------------------------------------\n4.4  Conclusion\n----------------------------------------------------------------\nBecause every inductive stage terminates, we obtain the desired\ninfinite sequence of consecutive $\\mathcal P$–pairs\n\\[\n(N_1,N_1+1),\\;(N_2,N_2+1),\\;(N_3,N_3+1),\\dots,\n\\]\ncompleting the proof of (b). ∎\n\n\n\n--------------------------------------------------------------------\n5.  Final remarks\n--------------------------------------------------------------------\n1.  The Chinese Remainder Theorem is the only external tool needed.\n\n2.  Inequality (1) corrects the earlier misstated strict inequality;\n    only the weaker bound $\\widehat{F'}\\le M+1$ is required and is now\n    explicitly recorded.\n\n3.  Each modulus produced by Lemma 1 recurs periodically, so every pair\n    $(N_j,N_j+1)$ generates an infinite arithmetic progression of\n    further consecutive $\\mathcal P$–pairs.\n    Consequently the set of losing starting positions has positive\n    lower density.",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.798015",
        "was_fixed": false,
        "difficulty_analysis": "1.  Richer move set.  Legal moves now require the number removed plus 1 to be a prime power pᵏ; analysing positions demands understanding prime powers rather than merely primes or primes shifted by a fixed amount.  \n2.  Extra arithmetic structure.  A prime power possesses exactly one distinct prime divisor; exploiting this rigidity forces players to use deeper number-theoretic arguments (CRT combined with multiplicity of prime factors) rather than the simpler “composite vs. prime” dichotomy of the original problem.  \n3.  Two goals instead of one.  Part (b) asks not just for infinitely many losing starts for Alice but for an entire arithmetic progression of them, pushing the solver to lift a single-instance argument to a uniform, modular one.  \n4.  Heavier theoretical toolkit.  Solving the variant efficiently requires the Chinese Remainder Theorem, the fundamental theorem of arithmetic (to distinguish prime powers from general composites), and game-theoretic reasoning about P- and N-positions; the original could be dispatched with any one of three short elementary tricks.  \nThese additions elevate both the conceptual and the technical hurdles well beyond those of the original and of the intermediate kernel variant."
      }
    },
    "original_kernel_variant": {
      "question": "Let a single heap initially contain $n\\ge 0$ stones.  \nOn every turn the player whose move it is must choose  \n\n$\\;$• a prime number $p$ (the choice $p=2$ is permitted), and  \n$\\;$• an integer exponent $k\\ge 2$\n\nand then remove exactly  \n\\[\nm=p^{\\,k}-1\n\\]\nstones from the heap.  \nThe legal subtraction set is therefore  \n\\[\n\\mathcal L=\\{\\,p^{k}-1:\\;p\\text{ prime},\\;k\\ge 2\\}\n           =\\{3,7,8,15,24,26,31,48,\\dots\\}.\n\\]\n(Observe that $1,2\\not\\in\\mathcal L$.)\n\nNormal play is used (the player making the last move wins) and Alice\nmoves first.\n\na)  Prove that there exist infinitely many initial heap sizes $n$ for\nwhich Bob (the second player) has a winning strategy.\n\nb)  Prove the much stronger fact that there are infinitely many\n\\emph{consecutive} starting sizes that are losing for Alice; that is,\nshow that there exist infinitely many integers $N$ for which Bob wins\nfrom \\emph{both} $N$ and $N+1$.",
      "solution": "We use standard Sprague–Grundy terminology.  \nA position is a $\\mathcal P$–position if the previous player can force\na win, and an $\\mathcal N$–position otherwise.\nEquivalently,\n\n$\\;$• a position is $\\mathcal N$ iff it has at least one option that is\n   $\\mathcal P$,  \n\n$\\;$• a position is $\\mathcal P$ iff \\emph{all} of its options are\n   $\\mathcal N$.  \n\nLet $\\mathcal P$ denote the set of $\\mathcal P$–positions and write\n$a\\equiv b\\pmod m$ as $a\\stackrel{m}{\\equiv}b$.\nFor a finite set $F\\subset\\mathbb N$ put $\\widehat F=\\max F$.\n\n--------------------------------------------------------------------\n0.  Three trivial $\\mathcal P$–positions\n--------------------------------------------------------------------\nThe numbers $0,1,2$ admit no legal move, hence belong to $\\mathcal P$.\n\n--------------------------------------------------------------------\n1.  A basic observation about the move set\n--------------------------------------------------------------------\n(★)  If a positive integer $x$ is divisible by two distinct primes, then\n$x$ is \\emph{not} a prime power.\nConsequently, if $y+1$ is divisible by two distinct primes, then\n$y\\not\\in\\mathcal L$.\n\n--------------------------------------------------------------------\n2.  Infinitely many $\\mathcal P$–positions (part a)\n--------------------------------------------------------------------\nAssume for contradiction that\n\\[\n\\mathcal P=\\{e_1,\\dots ,e_t\\},\\qquad\n0=e_1<e_2<\\dots<e_t .\n\\]\nChoose pairwise distinct primes\n$q_1,\\dots ,q_t,r_1,\\dots ,r_t$ with every $q_i,r_i>\\!e_t$.\nBy the Chinese Remainder Theorem (CRT) there exists $X$ such that  \n\\[\nX\\stackrel{q_i r_i}{\\equiv}e_i-1\\qquad(1\\le i\\le t),\n\\]\nand we set  \n\\[\nN:=X+2\\!\\!\\prod_{i=1}^{t}q_i r_i .\n\\]\nFor each $i$ we then have\n$N-e_i+1\\stackrel{q_i r_i}{\\equiv}0$, so $N-e_i+1$ is divisible by\n$q_i$ and $r_i$ and is therefore not a prime power.\nThus $N-e_i\\not\\in\\mathcal L$ for every $i$, i.e.\\ $N$ has no move to\nany $e_i$.\nAll other options are $\\mathcal N$ by definition, whence $N$ itself is\n$\\mathcal P$, contradicting finiteness of $\\mathcal P$.\nTherefore $\\mathcal P$ is infinite, proving (a). ∎\n\n\n\n--------------------------------------------------------------------\n3.  A strengthened blocking lemma\n--------------------------------------------------------------------\nLemma 1 (strong double blockade).  \nLet $F\\subset\\mathbb N$ be finite.\nThen there exists a pair of consecutive integers\n\\[\n(M,M+1),\\qquad M>\\widehat F,\n\\]\nsuch that neither $M$ nor $M+1$ has a legal move that ends in $F$.\n\nProof.  \nAssign to every $e\\in F$ four fresh primes\n$q_e,r_e,s_e,t_e$, all $>\\widehat F$ and pairwise distinct.\nBy the CRT choose $X$ obeying\n\\[\nX\\stackrel{q_e r_e}{\\equiv}e-1,\\qquad\nX\\stackrel{s_e t_e}{\\equiv}e-2\\qquad(e\\in F),\n\\]\nand set  \n\\[\nM:=X+2\\!\\!\\prod_{e\\in F}q_e r_e s_e t_e .\n\\]\nExactly as in Section 2, for each $e\\in F$ both $M-e$ and\n$(M+1)-e$ fail to lie in $\\mathcal L$, so the claim holds. ∎\n\n\n\n--------------------------------------------------------------------\n4.  Consecutive $\\mathcal P$–pairs (part b)\n--------------------------------------------------------------------\nWe build an infinite strictly increasing sequence\n\\[\nN_1<N_2<N_3<\\dots\n\\]\nsuch that every pair $(N_j,N_j+1)$ consists of $\\mathcal P$–positions.\n\n----------------------------------------------------------------\n4.1  Preparation\n----------------------------------------------------------------\nLet $S_{0}:=\\{0,1,2\\}$.\nFor $j\\ge 1$ we shall maintain a finite set $S_{j-1}$ which already\n\\emph{contains every} $\\mathcal P$–position not exceeding\n$\\widehat{S_{j-1}}$.\n\n----------------------------------------------------------------\n4.2  Inductive construction\n----------------------------------------------------------------\nAssume $S_{j-1}$ is available.\n\nStep 1. First try.  \nApply Lemma 1 with $F=S_{j-1}$, obtaining a pair\n\\[\n(M,M+1),\\qquad M>\\widehat{S_{j-1}},\n\\]\nthat cannot move into $S_{j-1}$.\n\nIf \\emph{both} $M$ and $M+1$ are $\\mathcal P$ we set\n\\[\nN_j:=M,\\qquad\nS_j:=S_{j-1}\\cup\\{M,M+1\\},\n\\]\nand proceed to the next index.\n\nOtherwise at least one of $M,M+1$ is $\\mathcal N$.  Let\n\\[\nT:=\\{e\\le M+1 : e\\text{ is }\\mathcal P\\},\\qquad\nF':=S_{j-1}\\cup T .\n\\]\nThe set $F'$ equals \\emph{all} $\\mathcal P$–positions not exceeding\n$M+1$, hence it is finite and satisfies\n\\[\n\\widehat{S_{j-1}}\\;<\\;\\widehat{F'}\\;\\le\\;M+1. \\tag{1}\n\\]\n\nStep 2. Further tries.  \nInvoke Lemma 1 with $F'$; let the resulting pair be $(M',M'+1)$.\nBecause $M'>\\widehat{F'}$ and by (1) we also have $M'>M+1$.\nIf both $M',M'+1$ are $\\mathcal P$ we record\n\\[\nN_j:=M',\\qquad\nS_j:=F'\\cup\\{M',M'+1\\}\n\\]\nand stop the inductive step.\nIf not, enlarge $F'$ by all $\\mathcal P$–positions up to $M'+1$ and\nrepeat Lemma 1.\nAs $\\widehat{F'}$ strictly increases each time, the process is\nwell defined.\n\n----------------------------------------------------------------\n4.3  Termination of the process\n----------------------------------------------------------------\nSuppose, for a contradiction, that in the $j^{\\text{th}}$ induction\nstage the repeated application of Lemma 1 never produces a pair of\nconsecutive $\\mathcal P$–positions.\nThis yields an unbounded sequence\n\\[\nM^{(1)}<M^{(2)}<M^{(3)}<\\dots\n\\]\nsuch that, for every $\\nu$,\n\n$\\;$• $F_\\nu$ (the set fed into the $\\nu^{\\text{th}}$ call of Lemma 1)\nequals \\emph{all} $\\mathcal P$–positions $\\le M^{(\\nu)}+1$,  \n\n$\\;$• both $M^{(\\nu)}$ and $M^{(\\nu)}+1$ have no move into $F_\\nu$.\n\nBecause the sequence $(M^{(\\nu)})$ is unbounded, every $\\mathcal P$\neventually belongs to some $F_\\nu$.\nHence for each $\\nu$ the numbers $M^{(\\nu)}$ and $M^{(\\nu)}+1$ possess\n\\emph{no} legal move to a lower $\\mathcal P$–position.\nAn $\\mathcal N$–position must have at least one such move, so\nboth $M^{(\\nu)}$ and $M^{(\\nu)}+1$ are forced to be $\\mathcal P$,\ncontradicting the assumption that no consecutive $\\mathcal P$–pair is\never produced.\nTherefore the procedure terminates after finitely many attempts at\nevery stage $j$.\n\n----------------------------------------------------------------\n4.4  Conclusion\n----------------------------------------------------------------\nBecause every inductive stage terminates, we obtain the desired\ninfinite sequence of consecutive $\\mathcal P$–pairs\n\\[\n(N_1,N_1+1),\\;(N_2,N_2+1),\\;(N_3,N_3+1),\\dots,\n\\]\ncompleting the proof of (b). ∎\n\n\n\n--------------------------------------------------------------------\n5.  Final remarks\n--------------------------------------------------------------------\n1.  The Chinese Remainder Theorem is the only external tool needed.\n\n2.  Inequality (1) corrects the earlier misstated strict inequality;\n    only the weaker bound $\\widehat{F'}\\le M+1$ is required and is now\n    explicitly recorded.\n\n3.  Each modulus produced by Lemma 1 recurs periodically, so every pair\n    $(N_j,N_j+1)$ generates an infinite arithmetic progression of\n    further consecutive $\\mathcal P$–pairs.\n    Consequently the set of losing starting positions has positive\n    lower density.",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.609169",
        "was_fixed": false,
        "difficulty_analysis": "1.  Richer move set.  Legal moves now require the number removed plus 1 to be a prime power pᵏ; analysing positions demands understanding prime powers rather than merely primes or primes shifted by a fixed amount.  \n2.  Extra arithmetic structure.  A prime power possesses exactly one distinct prime divisor; exploiting this rigidity forces players to use deeper number-theoretic arguments (CRT combined with multiplicity of prime factors) rather than the simpler “composite vs. prime” dichotomy of the original problem.  \n3.  Two goals instead of one.  Part (b) asks not just for infinitely many losing starts for Alice but for an entire arithmetic progression of them, pushing the solver to lift a single-instance argument to a uniform, modular one.  \n4.  Heavier theoretical toolkit.  Solving the variant efficiently requires the Chinese Remainder Theorem, the fundamental theorem of arithmetic (to distinguish prime powers from general composites), and game-theoretic reasoning about P- and N-positions; the original could be dispatched with any one of three short elementary tricks.  \nThese additions elevate both the conceptual and the technical hurdles well beyond those of the original and of the intermediate kernel variant."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}