Showing posts with label modular inverse. Show all posts
Showing posts with label modular inverse. Show all posts

Thursday, December 2, 2010

SPOJ MMOD29

Problem Link : http://www.spoj.pl/problems/MMOD29/en/

I was searching some problems that would require modular inverse / Chinese remainder theorem / Extended Euclidean algorithm. This problem requires the simplest case of modular inverse when the numbers in question are co-prime.

The problem in short
Find the sum of divisors of the number 2004^X mod 29 [1<=X<=10000000].
So, first we need to find the sum of divisors of an arbitrary number N. Let prime factorization of N is -