I'm thinking of a number (Robber's thread) Cop's thread here


In this cops-and-robbers challenge cops will think of a positive integer.  They will then write a program or function that outputs one value when provided the number as input and another value for all other positive integer inputs.  Cops will then reveal the program in an answer keeping the number a secret.  Robbers can crack an answer by finding the number.

Your job as robbers is to find that number.  Once found you can make an answer here detailing the number and how you found it.  You should link the original answer being cracked in your answer.

Your score will be the number of cracks with more being better.
Java, by okx

Note: the original challenge to which this post answers has been deleted, it's however still accessible with the link to anyone having the privilege to see deleted answers. The explanations below include what the challenge was about.

Number: 18

The code is effectively looking for primes with the form 112n-2.

By this Wikipedia list, we know that the 20th largest known prime number has 2,900,832 digits. No prime with the form 112n-2 are in that list, so that digit number will be our limit.

All numbers of the form 112n-2 that have at most that many digits have this constraint: n &lt; 22. Factordb tells us that 11222-2 has 4,367,918 digits. This is proof enough.

The code by okx limits us to n above 6.

So, let's do the list:

112n-2 is factorizable for n = 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20 and 21 (factors proofs are on factordb.com and wolfram alpha; factordb has some proofs that wolfram alpha hasn't and vice-versa).

The only value n for which we can't prove the factorization is 18 (factordb, WolframAlpha).

So (a) if there is a prime number of the form 112n-2 with n &gt; 6, then (b) 6 &lt; n &lt; 22, and (c) I proved each number with such n is composite except for 18, so (d) the prime we're looking for has n = 18.

Note that I don't exclude that 11218-2 is composite. I haven't proved that that number is a prime: I only proved that if the OP thought about that number, it can only be 18. If that number is indeed a prime, congrats to okx for finding it :-)

However

There are no proof that 11218-2 is the only number, though. It's the only number in the range of numbers for which we can currently prove the primality.

So I don't exclude the fact that one day someone might prove that 11251-2 or 112124-2 is prime.

I therefore believe that the original entry by okx is invalid because there are no such proof that for n between 19 and the (231-1)231-1 (the theoretical limit of Java's BigInteger), there are no other primes.