Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Sylvia Else Newsgroups: sci.electronics.design,sci.math Subject: Re: pattern found in Prime numbers Date: Mon, 21 Mar 2016 13:08:44 +1100 Lines: 258 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net kTNFO595vyBlHK/gTiLgSgqWjaXGV3Ugb6s30PBmxR1iojjjMa Cancel-Lock: sha1:zb5Wb+8SnoH2I+XXNZZWwydWYrg= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: Xref: csiph.com sci.electronics.design:403743 sci.math:330265 On 21/03/2016 4:39 AM, Jamie Morken wrote: > On 3/20/2016 6:51 AM, David Eather wrote: >> On Sun, 20 Mar 2016 12:20:26 +1000, Sylvia Else >> wrote: >> >>> On 20/03/2016 8:51 AM, Jamie Morken wrote: >>>> Hi, >>>> >>>> I found a pattern in the prime numbers, I used an encoded binary >>>> sequence, and the pattern became clearly visible: >>>> >>>> http://imgur.com/BI1rAp4 >>>> >>>> That's all zeros and ones, depending on if a prime is at the >>>> positions given by the formulas: >>>> >>>> y = 30x + 1 >>>> y = 30x + 7 >>>> y = 30x + 11 >>>> y = 30x + 13 >>>> y = 30x + 17 >>>> y = 30x + 19 >>>> y = 30x + 23 >>>> y = 30x + 29 >>>> >>>> The pattern can be seen if the zeros and ones are displayed as >>>> a bitmap, but only if there is the correct number of columns >>>> in the bitmap, and that is the pattern I found, the column >>>> count to show the pattern seems to be this for primorial30: >>>> >>>> 8*prime (where 8 is how many coprimes 30 has) >>>> >>>> I tested prime 7 so far, but I think the pattern seen might hold >>>> for larger primes too. >>>> >>>> When 8*7=56 columns are used ie here are the first 20 rows, all having >>>> columns of zeros: >>>> >>>> 0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,0,1,1,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0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,0,0, >>>> >>>> >>>> >>>> 1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,1,0,1, >>>> >>>> >>>> >>>> 0,0,0,1,1,0,1,0,0,0,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1, >>>> >>>> >>>> >>>> 0,0,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0, >>>> >>>> >>>> >>>> >>>> The columns of zeros match up to give these patterns that can be >>>> verified: >>>> >>>> 30x+7 is always NOT prime every seventh x >>> >>> Obvious. >>> >>>> 30x+19 is always NOT prime every seventh x (offset one from x for >>>> 30x+7) >>> >>> 30x + 19 mod 7 ≡ 2x + 5 mod 7. >>> >>> If we want the result to be divisible by 7, then >>> >>> 2x + 5 mod 7 ≡ 0 >>> >>> 2x ≡ -5 mod 7 ≡ 2 mod 7. >>> >>> Multiply by the multiplicative inverse of 2 mod 7, which is 4. >>> >>> 4 * 2 * x mod 7 ≡ 4 * 2 mod 7 >>> >>> 8 * x mod 7 ≡ 8 mod 7 >>> >>> 1 * x mod 7 ≡ 1 mod 7 >>> >>> x ≡ 1 mod 7. >>> >>> That is, for x = 1, 8, 15, 22 ... 30x + 19 is divisible by 7, and >>> hence not prime. >>> >>> Your "discoveries" are of no importance whatsoever. >>> >>> >>>> 30x+17 is always NOT prime every seventh x (offset two from x for >>>> 30x+7) >>>> and continuing for other zero columns. >>> >>> Can be proved (if it's true, I haven't checked) the same way as above. >>> >> >> All these are prime (the first col is the value of x): >> >> 7 227 >> 21 647 >> 28 857 >> 42 1277 >> 49 1487 >> 56 1697 >> 63 1907 >> 98 2957 >> 105 3167 >> 126 3797 >> >> not real sure what you mean by offset of 2 but if it turn 227 to 229 >> that is also prime > > > Hi, > > For the offsets here is the full list: > > 30x+1 is always not prime every seventh x (for x starting at 3) > 30x+7 is always not prime every seventh x (for x starting at 0) > 30x+11 is always not prime every seventh x (for x starting at 6) > 30x+13 is always not prime every seventh x (for x starting at 5) > 30x+17 is always not prime every seventh x (for x starting at 2) > 30x+19 is always not prime every seventh x (for x starting at 1) > 30x+23 is always not prime every seventh x (for x starting at 7) > 30x+29 is always not prime every seventh x (for x starting at 4) > > How can I automatically find these formulas? > > cheers, > Jamie > > In general, you want the following m * (nx + f) + k == 0 mod n Where m corresponds to your 30, n corresponds to your "seventh" and f is your offset (i.e. starting at...). Having chosen those three numbers, you can calculate k. Expanding m * nx + m * f + k == 0 mod n The first term is always 0 mod n So m * f + k == 0 mod n m * f == -k mod n -m * f == k mod n To determine k from that, take the remainder of dividing (- m * f) by n (the remainder is negative), and then add n to it. For example, if m is 30, f is 2, and n is 7, then we get -m * f = -60. The remainder when dividing by 7 is -4, add 7 gives 3. So 30x + 3 is not prime for every seventh x starting at 2. Clearly you can add any muliple of n to k. In your example, you added twice 7, giving 30x + 17 is not prime for every seventh x starting at 2. However, if the result adding a multiple of 7 to k, is a number that is not coprime with 30, then none of the results will be prime. At least one of your examples is wrong: If f is 6, then we get -180 divided 7 gives remainder -5, so k is 2. That is 30x + 2 is not prime for every seventh x starting at 6. You said 30x + 11... starting at 6. 30 * 6 + 11 is 191, which is prime. Sylvia.