This is just a sandbox for you to work in, if you’d like. Be aware that there is no way to save your work except to cut and paste it elsewhere.
Some common commands:
Mod(a,n)
computes the residue ofa
modulon
. If you need to do a giant exponent, put it outside, likeMod(a,n)^e
so the computer does it sensibly.gcd(a,b)
computes the gcd ofa
andb
.xgcd(a,b)
computes the extended euclidean algorithm ofa
andb
(i.e. it outputs the solution to the linear Diophantine equation $ax+by=gcd(a,b)$).primitive_root(p)
will give a primitive root modulop
.next_prime(n)
will compute the first prime aftern
(e.g. $n+1$, $n+2$ etc.)is_prime(n)
will return True ifn
is prime, and false otherwise.factor(n)
will display a factorization ofn
.euler_phi(n)
will compute the Euler phi (totient) function ofn
.randint(n,m)
will give a random integer betweenn
andm
inclusive.