## 26 January 2007

### Twin Primes

So as I rewrite my Balanced Ternary (ī,0,1) library once again, something occurs to me...

While it is not visually obvious which numbers are multiples of two, we do know that all multiples of 3 end in 0. Since no prime (except 3) can be a multiple of 3, that means that all primes are going to end in ī or 1. Well, since we know all primes are odd, that also means that the specific number with a 0 ending would have also been a multiple of 2. IE: The number ending in 0 would have been a multiple of 6.

Where am I going with this? Well, let's look at the first few multiples of 2*3
6 - 5 and 7 are twin primes
12 - 11 and 13 are twin primes
18 - 17 and 19 are twin primes
24 - 23 and 25... nope, not that one (23 is prime though, other is 52)
30 - 29 and 31 are twin primes
36 - 35 and 37... nope, not that one (37 is prime though, other is 5*7)
42 - 41 and 43 are twin primes
48 - 47 and 49... nope, not that one (47 is prime though, 49 is 72)
54 - 53 and 55... nope, not that one (53 is prime though, other is 5*11)
60 - 59 and 61 are twin primes
66 - 65 and 67... nope, not that one (67 is prime though, other is 5*13)
72 - 71 and 73 are twin primes
80 - 79 and 81... nope, not that one (79 is prime though, 81 is 92)

well obviously that wasn't the "correct solution"...

let's start with a simple question - did we miss any twin primes?
well we miss (3,5) - but that could just be because we were specifically looking for multiples of 6.
other than that, we did not skip any twin primes

well some are when we have squares (52, 72, 92)
the others are 5*{7,11,13}
could be a pattern there... partial one anyways...

let's look at it from another aspect... what primes did we miss?
obviously anything below 6 since we started with multiples of 6
other than that, we got all primes...
and 6 extra values below 82... so about 7% too many

it has to become less usable as we get higher, doesn't it?
600 - 599 and 601 are twin primes
606 - 607 is prime
612 - 613 is prime
618 - 617 and 619 are twin primes
624 - (neither 623 or 625 are prime)
630 - 631 is prime
636 - (neither 635 or 637 are prime)
642 - 641 and 643 are twin primes
648 - 647 is prime
652 - 653 is prime
660 - 659 and 661 are twin primes

and no primes are missing (though a couple extras)