It has long been understood that any random whole number that ends in a 0, 2, 4, 5, 6, or 8 is not prime, except for the two primes, 2 and 5. This is 60% of all numbers. If you want to increase this 60% of easily detected composite numbers to 77.1%, first check the last digit of a candidate number as above and then apply the following 21 element template around the candidate number (it must therefore be assumed that you've first determined that the candidate does end in a 1, 3, 7, or 9): 1,1,0,1,1,0,0,1,0,1,1,0,1,0,0,1,1,0,1,1,0 You may properly position this template after the number 21 as follows (note that the template does not work below the number 22): Divide the candidate number by 21 and obtain a remainder (between 0 and 20). Add 20 to that remainder if the remainder is 0 (or you can simply quit here because it's obvious that the number is not prime), otherwise subtract 1. Then subtract that result from your candidate number to get a final result, and then overlay the 21 elements in the above order starting at that final result. If your candidate number is overlain by a zero then it is not prime. The 1's in the template have no meaning -- they may be thought as merely "filler." Example for candidate 23456793: 23456793 / 21 = 1116990 with a remainder of 3 3 - 1 = 2 23456793 - 2 = 23456791 1 1 0 1 1 0 0 ... 23456791 23456792 23456793 23456794 23456795 23456796 23456797 ... -------- Note that 23456792 has a 1 overlaying it even though it is also not prime. If your candidate was 23456792, then you would have eliminated it before doing this exercise because it ends in a 2. This template does not point out ALL composites, nor does it imply that any number with a 1 overlaying it is prime. In fact, the number 23456791 is not prime and ends in a 1, and this template does not catch it. The template merely points out only a few trillion^trillion^trillion composite numbers that end in 1, 3, 7, or 9. If your candidate number is, say, 63, then the calculation would be: Example for candidate 63: 63 / 21 = 3 with a remainder of 0 simply change the 0 to 20 63 - 20 = 43 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 0 --------------------------------------------------------------- 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 This template may be shifted 21 numbers at a time throughout the whole number set to infinity, starting at 22 (or starting at any "proper" position as in the examples above). Wherever a 0 heads a column, all numbers in that column are definitely not prime. Template: 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 0 -------------------------------------------------------------- Numbers: 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ... ***