Use Fermat's theorem to calculate the remainder when 3^1000 is divided by 7.
Fermat's theorem is used to calculate the remainder.