using System;
using System.Numerics;
public class Program
{
public static void Main()
BigInteger p = 533000401;
BigInteger q = 553105243;
// Set them to two lower numbers to demonstrate the phenomonon
//p = 7;
//q = 13;
for(int n = 1; n < 50; ++n)
Console.WriteLine("{0}^{1} mod {2} = {3}", p, n, q, BigInteger.ModPow(p, n, q));
}