title: Oscillate counter increment?
body: <p>I want to reduce the computing load in a test for primes. Currently my loop just tests odds, like so: </p>
  
  <pre><code>for (k=3; k&lt;=end; k+=2) {
  </code></pre>
  
  <p>I read that every prime other than 2 and 3 is a function of k= 6 +/- 1 though. By only testing 2/3rds of the odds I can reduce computing load by 33%. The only way I can think to do this is to oscillate the counter to increment by 2, then 4, then 2, then 4 each iteration, for example testing 5, 7, 11, 13, etc. </p>
  
  <p>Is there a way to tell the loop to do this? Is there another way to do this I'm not considering? </p>
  
  <p>P.S. I'm aware of the sieve method of testing</p>