Updated MathAlgorithms.cs

Added a primality test.