Modular exponentiation

From Rosetta Code
Revision as of 22:32, 18 December 2011 by rosettacode>Kernigh (Do a**b mod m with huge a, b. Wiki has error with <math> tags; I expect that someone will fix error.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Modular exponentiation is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Find the last 20 decimal digits of , where

A computer is too slow to find the entire value of . Instead, the program must use a fast algorithm for modular exponentiation: .

The algorithm must work for any integers where and .