title: Prime Number Formula
body: <p>I am trying to write a prime number function in C# and I am wondering if the follow code will work. It "appears" to work with the first 50 numbers or so. I just want to make sure it will work no matter how big the number is:</p>
  
  <pre><code>static bool IsPrime(int number)
  {
      if ((number == 2) || (number == 3) || (number == 5) || (number == 7) || (number == 9))
              return true;
  
      if ((number % 2 != 0) &amp;&amp; (number % 3 != 0) &amp;&amp; (number % 5 != 0) &amp;&amp;
          (number % 7 != 0) &amp;&amp; (number % 9 != 0) &amp;&amp; (number % 4 != 0) &amp;&amp;
          (number % 6 != 0))
          return true;
  
          return false;
   }
  </code></pre>