Problem Posts |
Just a quick post for younger readers. Often one will find oneself using `brute force' approaches when obvious tricks and shortcuts exist. Most of the time, this is justified -- many tricks are usually too arcane to remember, or too impracticable to execute realistically. This is neither. It's fast, simple, and it could save you in a Do-Or-Die (I've used it before; our team won!)
What is a factor?
First things first, right? Not everybody defines the word “factor” the same way. I will be using the convention used in most local contests: A factor of an integer $n$ is a positive integer $a$ for which there exists an integer $b$ such that $n=ab$. So by our convention $4$ and $-4$ both have exactly three factors: 1, 2, and 4. We do not consider $-2$ as a factor, even if it divides both $4$ and $-4$. On the other hand, a factor of a number is a proper factor iff it is not the number itself. Often 1 is also not considered a proper factor. With this ambiguity, however, the term is not used too often in contests.