Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Without using the fact that 2803 is prime, Calculate $2^{1401} \pmod{2803}$

Usually I would do something like:

$1401 = 3\times467$
$\equiv(2^{467})^3 \pmod{2803}$

And try to simplify it down and use the mod to get it down to something I can punch in the calculator, but in this case $2^{467}$ does not help as it is still too large.

If I did $(2^{3})^{467}$ that also does not seem to help as I just end up with $8^{467}$ and is too large

What other techniques can I use here?

share|cite|improve this question
up vote 1 down vote accepted

Use exponentiation by squaring. It easily adapts to exponentiation with a modulus. You have the right idea by trying to factorize the exponent. All there is left to notice is that you do not need to factorize it, e.g., $1401 = 2 \cdot 700 + 1$ means you can compute $2^{700} \ (\text{mod} \ 2803)$, then square that and multiply by 2.

share|cite|improve this answer
Ahh I understand, thanks heaps – Arvin Sep 26 '12 at 1:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.