## Modular arithmetic

from PyECC import *

A = Zn(17)

# Projection of 3 to A
a = 3>>A
show('a :',a)

# Order of a
show('order(a) :', order(a))

# Order of 3 mod 17
show(order(3,17))

# lift of a
show('integer representative of a :', lift(a))

# Powers of a, seen as integers
P = [lift(a**j) for j in range(17)]
show(P)


# Powers of 3 mod 17
Q=[3**j % 17 for j in range(17)]
show(Q)