print("{:22}".format("n ≡ ... [4] |"),end="") for n in range(4): print("{:2d}".format(n%4),end=" | ") print() print("{:22}".format("2n ≡ ... [4] | "),end="") for n in range(4): print("{:2d}".format(2*n %4),end=" | ") print() print("{:22}".format("n² + 1 ≡ ... [4] | "),end="") for n in range(4): print("{:2d}".format((n**2+1)%4),end=" | ") print() print("{:22}".format("2n(n² + 1) ≡ ... [4]| "),end="") for n in range(4): print("{:2d}".format((2*n*(n**2+1))%4),end=" | ")