TITLE: Is 2014411 Prime?
QUESTION [8 upvotes]: I want to figure out whether the number 2014411 is prime or not.
What kind of mathematical searching tools/strategy I have?
Do I have to start from 1 and proceed to 2014410 while I found one as a divisor or any other efficient way to find it?

REPLY [9 votes]: If you don't want to use a calculator or a computer, you have to rely on instinct. Guess right and you may quickly discover the prime factorization of a given number. Guess wrong and you might be forced to give up and ask a computer.
Take for instance the number $2013461$. It's not divisible by any of the first twenty primes, but it's not prime itself either. Could it be the square of a prime? It's not, actually, since $\sqrt{2013461} \approx$ $1418.96$.
Trying every prime up to $1409$ sounds like it could take a very long time by hand. Fermat came up with a method that might help in this case. Try $\sqrt{2013461 + y^2}$ for $y = 1, 2, 3, \ldots$ until you get an integer (it would really help to memorize the last two digits of the first hundred squares, e.g., 2013465 and 2013470 are obviously not squares).
And then we find $2013461 + 10^2 = 1419^2$, which, Fermat taught us, means $$2013461 = 1419^2 - 10^2 = (1419 - 10)(1419 + 10) = 1409 \times 1429.$$
This method would be of little help with $2014411$ because its prime factors, $7$, $31$, $9283$ are much farther apart. In cases like this, you're better off just going with trial division.
In the worst case scenario, the number to be factored is the square of a prime, e.g., $2036329$. But since the squares get thinner as the numbers get larger, you're likelier to run into the best case scenario of trial division: that a composite number has lots of small prime factors.
Another method that might interest you, somewhat more sophisticated but which also has its best case and worst case scenarios, is Pollard's $p - 1$ method.