Let S(A) be {1,2,3,...,(A1)} and S'(A,B) be the set of elements X from S(A) that satisfy X^B mod A=1. Assuming that A is prime, find the sum of all the elements of S'(A,B) in terms of A and B.
Its a cyclic sequence of (A1) entries.
Now take GCD of A1 and Bmod(A1).
All the possible B values from 1 to A1 with the same GCD,
have the same sum. Now take cases of odd and even values of B.

Posted by Praneeth
on 20070725 08:47:48 