prime number search algorithm in C#