\[ P(\textrm{never black}) = \prod_{n = 2}^{\infty}( 1 - \frac{1}{2^n}),\] the index should start at 1, not 2 as written. The post itself was fascinating! ]]>

We need n!=(m-1)(m+1), where n>100. As mentioned in the blog post, n! will need to have a large number of zeros at the end

=> (m-1)(m+1) needs to be divisible by a fairly large power of 2. But only one of them is 0 mod 4. Lets say (m-1) is this number. Then, m+1 cannot have more than 1 zero at the end, so we are looking for n! = (k*10^L) (k*10^L+2), or (k*10^L) (k*10^L-2).

For non-square k, I meant that it is easy to prove that there are only finitely many examples and even to enumerate all examples as long as you’re willing to run in time poly(k). Then, this procedure suffices:

1) Find a modulus m such that k is not a square mod m. (This can be done by factoring k and then applying quadratic reciprocity and the CRT. One can always get a value less than k.)

2) Enumerate all examples of squares n!+k for n < m.

Of course, the resulting enumeration gives all examples of n!+k for which k is prime, but it runs in time proportional to k.

I'm not sure about very large non-square k. Obviously, there exist non-square k such that n! + k is a square for very large n. I don't immediately see an efficient way to find such an n, given k, and certainly not a way to categorize all such n.

(I should clarify that I'm not an expert in number theory or diophantine equations, so I apologize if I said something stupid above.)

]]>The same proof works for n! + 2 (which is never square)

Except for \(n=2\).

how easy it is to analyze n!+k where k is not itself a square

Agreed where \(k\) is a small square. (Where the number of digits in \(k^2\) is less than the number of trailing zeros in \(n!\).) Not sure it’s so easy for larger \(k\). Can you elaborate?

]]>I’ve spent a few hours on this problem every year or so since undergrad (maybe 10 years ago?). I’m glad to know that it does in fact appear to be hard. What’s particularly maddening about it is how easy it is to analyze n!+k where k is not itself a square. E.g., n! - 1 is only a square when n=1 or n= 2 because for \(n \geq 3\), \(n! - 1 \equiv 2 \bmod 3\), so it can’t be a square. The same proof works for n! + 2 (which is never square), and a similar proof works for n! + 3 (which is only a square when n = 1 or n=3).

Incidentally, I think this question arises fairly naturally in the study of factorial primes.

]]>In this particular puzzle it’s not actually necessary to apply the uniqueness constraint. There is at least one other pathway to a solution—which I’ll leave to you to find.

Your sequence of moves is the pathway I had in mind.

]]>