Using Fermat's Little Theorem: 18^{802}(mod29) Calculation

  • Thread starter Thread starter bendaddy
  • Start date Start date
  • Tags Tags
    Theorem
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
bendaddy
Messages
4
Reaction score
0

Homework Statement


Use Fermat's Little Theorem to calculate 18[itex]^{802}[/itex](mod29)


Homework Equations


Fermat's Little Theorem: a[itex]^{p-1}[/itex][itex]\equiv[/itex]1(modp)
where in this case, a=18 and p=29


The Attempt at a Solution


By FLT, I found that 18[itex]^{28}[/itex][itex]\equiv[/itex]1(mod29)
So, 18[itex]^{802}[/itex][itex]\equiv[/itex](18[itex]^{28}[/itex])[itex]^{28.5}[/itex]*18[itex]^{4}[/itex](mod29)[itex]\equiv[/itex]18[itex]^{4}[/itex](mod29)[itex]\equiv[/itex]25(mod29)

So my solution is 25(mod29).
However, the solution my professor posted is 4(mod29) (**NOT -4(mod29)**). Pretty confused here... Is there something wrong in my logic?
 
Physics news on Phys.org
hi bendaddy! :smile:
bendaddy said:
By FLT, I found that 18[itex]^{28}[/itex][itex]\equiv[/itex]1(mod29)
So, 18[itex]^{802}[/itex][itex]\equiv[/itex](18[itex]^{28}[/itex])[itex]^{28.5}[/itex]*18[itex]^{4}[/itex](mod29)[itex]\equiv[/itex]18[itex]^{4}[/itex](mod29)[itex]\equiv[/itex]25(mod29)

isn't 1814 minus 1 ? :confused: