IDLE 2.6.4 >>> # these 4 test are all that is needed to find the order of 2 in Z/101Z* >>> pow(2, 25, 101) 10 >>> pow(2, 50, 101) 100 >>> pow(2, 4, 101) 16 >>> pow(2, 20, 101) 95 >>> # The fillwoing are given jsut illustating Fermat's last theorem >>> # - sure to get these results >>> pow(2, 100, 101) 1 >>> pow(2, 100, 101) 1 >>> # Hence both factors of 2 and both factors of 5 are needed for the order >>> # of the element 2 +101Z. >>> >>> # I made an error in class suggesting that the base 5 >>> # had something to do with this problem. >>> # The book example dealt with the generator *2* only. >>> # Another annoyance with the book example is the use of 2 >>> # in several different ways: as generator and as group order factor. >>> # We could test the order of the group generated by 7 similarly: >>> pow(7, 25, 101) # remove max factors of 2 from power 100 10 >>> pow(7, 50, 101) # remove one less factor of 2 100 >>> pow(7, 4, 101) # remove max factors of 5 from 100 78 >>> pow(7, 20, 101) # remove one less factor of 5 84 >>> # hence need all factors of 2 and of 5: >>> # 7 has order 100 and generates all of Z/101Z*