Compare the procedures, above, with what the RSA company says...
The RSA algorithm works as follows: take two large primes, p and q, and compute their product n = pq; n is called the modulus. Choose a number, e, less than n and relatively prime[coprime] to [φ](p-1)(q-1), which means e and [φ](p-1)(q-1) have no common factors except 1. Find another number d such that (ed - 1) is divisible by [φ](p-1)(q-1). [e × d ≡ 1 mod φ] The values e and d are called the public and private exponents, respectively. The public key is the pair (n, e); the private key is (n, d). The factors p and q may be destroyed or kept with the private key.
Also, refer to: http://people.csail.mit.edu/rivest/Rsapaper.pdf
Credit for learning how to do this goes to Jordan Haack on YouTube: RSA Encyption (this is exactly how he spelled it). This exercise focuses on the math behind RSA encryption.
Here, he's done everything for us!
Written by Vinyasi in the summer of 2016, copyleft.