ProgrammingVery hard

The modular inverse of 3 modulo 1000000007 is which value?

  1. A. 333333335
  2. B. 333333337
  3. C. 333333336
  4. D. 666666670

Correct answer: C. 333333336

Fermat's little theorem gives 3^(p-2) mod p = 333333336, and 3 x 333333336 = 1000000008 = 1 (mod p).

More C Programming questions

Exams that ask this topic