What is the smallest factor of 123456! + 1?
That number is approximately 2.6 * 10574964
Hi Joey. LOL. I knew I’d left that as a possibilty – thanks for posting it.
I want a number greater than 1.
I have not checked but I bet 123457 is a prime so as per Wilson theorem it is 123457. Otherwise it would not have been asked.
Hi Kali. I knew you’d know the trick.
since n! contains multiplication of all the numbers till n. So n! + 1 will be a prime number, because if we divide n! to any number smaller then or equal to n, then we get 1 as the remainder.
Hence in the case of 123456!+1 the smallest factor will be 123456! + 1 itself.
Hi Vedsar. 123456! + 1 isn’t a prime. It is divisible by 123457.
You’re partly right, n! + 1 cannot have a prime factor less than or equal to n. If it is composite, then it’s prime factors must be greater than n and less than or equal to Floor[Sqrt(n!+1))
In general, n! + 1 can be prime or composite.
e.g. 3! + 1 = 7 and is prime, but 4! + 1 = 25 = 5*5 and is composite
Wilson’s theorem says that, if and only if n is a prime, then (n-1)! + 1 is divisible by n.
If 123457 wasn’t a prime, then the smallest prime factor could be extremely large, and except for extraordinary luck, it wouldn’t be feasible to answer the question – even armed with a supercomputer.
i got it chris…..you are absolutely correct.
But i think my answer to the question was correct…..lol…