PROJECT EULER · #0122
Efficient Exponentiation
The most naive way of computing
But using a "binary" method you can compute it in six multiplications:
However it is yet possible to compute it in only five multiplications:
We shall define
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.