# Prime number building game

Players $A$ and $B$ choose digits $(0, \dots , 9)$ turn by turn and build number by concatenating the digit they chose to the end of the number. Player $A$ starts by picking the first (one-digit) number. Player scores a point if the number that is formed after the player's turn is prime.

The problem with this game is that there is no end. So can we even talk about a winning strategy? If either player could always score and make it so that the other one (even sometimes) can't score, then we could say the first mentioned is winner. But I believe this is hard to say, since we don't know that much about prime numbers and how they are distriputed in the decimal system (except of course that primes don't end in even digits or in digit five, with the exceptions of $2$ and $5$, so player should almost never choose those, or maybe yes to make future turns more profitable).

One other thing I thought about was the sum of the digits and divisibility by $3$. And there's the "divisibility by $11$" -rule also. But that's about all I came up with.

So my question is that is there a winning strategy or can we even talk about winning the game, since it has no end?

Another question: What would be the numbers where as many as the substrings when taking the last digits away one at a time are prime. (Maybe not each truncation but large percent of them.) I found $37337999$, which is prime for all removings, but is this the longest? It can't be made longer but how about starting with other digits? I don't have a good program to test this with. I just use http://www.alpertron.com.ar/ECM.HTM to check primality.

• You could talk about a winning strategy limiting the number of turns to $N$ and then try to extract a sort of "limit strategy" for $N\to\infty$. – AlexR Nov 12 '14 at 11:08
• I think you'll want to have a look at the "right-truncatable primes" at oeis.org/A024770 – Gerry Myerson Nov 13 '14 at 9:21
• @GerryMyerson That's it. But why does the list end in $31193$? In the comments it says: "The sequence ends at a(83) = 73939133". So $8$ digits is the longest when we demand all truncations to be prime. – ploosu2 Nov 13 '14 at 9:31
• If A starts with an $8$ and B plays a $9$, does it count as a win for B ? (since there are no primes of the form 89x) – Yaitzme Nov 13 '14 at 9:49
• The front page only ever gives the first 50 terms of a sequence. If you scroll down to Links, there's a link to the full list. – Gerry Myerson Nov 13 '14 at 11:11