Succesive squaring

computes a^k mod m really quickly
cooler checks