## 123456

Posted by Chris on August 8, 2012 – 3:19 pm

What is the smallest factor of 123456! + 1?

That number is approximately 2.6 * 10^{574964}

Posted by Chris on August 8, 2012 – 3:19 pm

What is the smallest factor of 123456! + 1?

That number is approximately 2.6 * 10^{574964}

August 8th, 2012 at 10:39 pm

1

August 9th, 2012 at 2:56 am

Hi Joey. LOL. I knew I’d left that as a possibilty – thanks for posting it.

I want a number greater than 1.

August 9th, 2012 at 6:43 am

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.

August 9th, 2012 at 9:07 am

Hi Kali. I knew you’d know the trick.

August 14th, 2012 at 12:52 pm

Hello Everyone,

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.

August 14th, 2012 at 1:50 pm

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.

August 14th, 2012 at 11:23 pm

i got it chris…..you are absolutely correct.

But i think my answer to the question was correct…..lol…