Finding Divisors A divisor (D) of a number (N) is an integer that divides another integer with no remainder. In other words N mod D = 0. Sometimes, we are interested in finding all divisors of a number. If we are considering a programming solution to this problem, chances are we are dealing with very…
Prime Numbers
Prime Number Testing
A prime number (or a prime) is defined as a positive integer greater than 1 that has no positive divisors other than 1 and itself. If I wanted a programmatic test that a number is prime, my first instinct in C# would look something like this: static bool IsPrime(int number) { for(int i = 2;…