Tag Archives: prime numbers

Primality testing with Fermat’s little theorem and Miller-Rabin in C#

Prime numbers have many applications. For example, in cryptography. The RSA algorithm for public-key cryptography uses large prime numbers for generating keys. Quote: 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 [...]

Posted in C# | Also tagged , , , , , , , , , , , , , , , , | 2 Comments

(C#) Factorial prime numbers factorization

Find how many factors there is in N! for a prime P Ex: 5! = (2^3)*(3^1)*(5^1) mult(5,2) = 3 mult(5,3) = 1 mult(5,5) = 1 all else = 0

Posted in C# | Also tagged , , , , , | Leave a comment

(C#) Prime Number Generator

 

Posted in C# | Also tagged , , , , , , | Leave a comment