Um, small writeup here, but all prime numbers other than 2 and 3 are one more or one less than a multiple of 6.

So if you're looking for prime numbers, or testing to see if a number is prime, knowing this cuts out 2/3 of the numbers for you.


Good point, Gritchka. ok, to show how this is useful:
finding the prime factors of a number:
(in C, to make my life easier)

void PrintFactors(int number) {
   int a,b,limit;

   while ((number%2)==0) printf("2*",number/=2);
   while ((number%3)==0) printf("3*",number/=3);

   a = 6-1;
   b = 6+1;

   limit = isqrt(number); /* integer square root */

   while (a < limit) {

      while ((number%a)==0) printf("%d*",a,number/=a);
      while ((number%b)==0) printf("%d*",b,number/=b);

      a += 6;  b += 6;
   }

   printf("%d",number);
}

(forgive my cheating with extra params for printf)
This should take about 2/3 as long as something that checked every odd number, or 1/3 as long as something that checked every integer.

Or if you're trying to do the Sieve of Eratosthanes for some reason, you can save time and memory by not representing other numbers at all. Have a table of all numbers that are 6n+1 and another for 6n-1.