Using divisibility rules, It can be proven that if you take a prime number and replace two or more of its digits randomly, then the probability of the new number being prime will always be less than half.

So, if the number has two or more digits missing we can confidently say the answer will always be “Not Prime”. Now, for the numbers with 0 or 1 digits missing, we can generate all possible numbers and check whether it is prime or not using popular primality checking algorithms (ie. Miller-Rabin primality test).

Statistics

43% Solution Ratio
s_semicolonEarliest, Dec '21
NirjhorFastest, 0.2s
NirjhorLightest, 1.1 MB
NirjhorShortest, 1613B
Toph uses cookies. By continuing you agree to our Cookie Policy.