My Math Forum Twin primes distributed around N mod 3 =0

 Number Theory Number Theory Math Forum

 February 19th, 2011, 09:48 AM #1 Senior Member   Joined: Jan 2011 Posts: 120 Thanks: 2 Twin primes distributed around N mod 3 =0 Since there are quite a few prime number topics on this forum, here's a thought I developed a few years ago (but did not progress since then): I started by postulating that all pairs of twin primes are equidistant around $n^2$ mod 3 = 0. Examples: * 29,31 and 41,43 around 36 (distance 5, 36 mod 3 = 0) * 17,19 and 269, 271 around 144 (distance 125, 144 mod 3 = 0) Didn't get much further with that, but with some good help we could potentially prove a weaker version of the postulate and that is: IF two pairs of twin primes (except the first pair 3,5) are equidistant around N (not necessarily a square), then N mod 3 MUST be 0. Here's the prove: Equidistant pairs of twin primes are of the shape (N-k-2, N-k) and (N+k, N+k+2) Suppose that N mod 3 <> 0, then the remainder is either 1 or 2. The case N mod 3 = 1 implies that: • k mod 3 must be <> 2 (since (N + k) mod 3 = 0 is not prime) • k mod 3 must be <> 1 (since (N - k) mod 3 = 0 is not prime) • so, k mod 3 must be 0, but then (N+k+2) mod 3 = 0 is not prime) -> (N-k-2, N-k),(N+k, N+k+2) can't be all prime when N mod 3 = 1 The case N mod 3 = 2 implies that: • k mod 3 must be <> 1 (since (N + k) mod 3 = 0 and is not prime) • k mod 3 must be <> 2 (since (N - k) mod 3 = 0 and is not prime) • so, k mod 3 must be 0, but then (N-k-2) mod 3 = 0 and is not prime) -> (N-k-2, N-k),(N+k, N+k+2) can't be all prime when N mod 3 = 2 This proves that (N-k-2, N-k),(N+k, N+k+2) can only be a set of equidistant twin primes in case N mod 3 = 0 (excluding the first twin pair 3,5) Now we know that N mod 3 must be 0, how about k ? • k mod 3 <> 0 otherwise N+k mod 3 en N-k mod 3 would be 0 • k mod 3 <> 1 otherwise N+k+2 and N-k-2 mod 3 would be 0 • so, k mod 3 must be 2 which implies k = 3m + 2, m=0,1,2... When N is even, k must be: k = 5, 11, 17 ... When N is odd, k must be: k = 2, 8, 14 ... This poses the inverse question whether all N mod 3 = 0 also have two equidistant pairs of twin primes? This has a surprising outcome. We learned (empirically tested up to N=1E6), that apparently only for N = 3, 6, 48, 198, 201, 258, 348, 393, 453, 558, 573, 633, 678, 1623 and 2103 no equidistant set of twin primes exists. There is a related Sloane's series http://oeis.org/A072254. A further surprise is that k relative to N remains remarkably small (< 1%). Obvious question is whether there is any N (mod 3 = 0) > 2103 that has no equidistant set of twin primes. Any thoughts/ideas?
 February 19th, 2011, 12:23 PM #2 Senior Member   Joined: Dec 2007 Posts: 687 Thanks: 47 Re: Twin primes distributed around N mod 3 =0 ...
 February 19th, 2011, 12:33 PM #3 Senior Member   Joined: Dec 2007 Posts: 687 Thanks: 47 Re: Twin primes distributed around N mod 3 =0 it is clear that in any pair of twin primes p, q, such that p\ a\equiv\ 2 \pmod{3}\==>\ a+1\equiv\ 0 \pmod{3}=$ the question of $q_1+a+1=n^2$ is interesting, I'll test some values
 February 19th, 2011, 02:26 PM #4 Senior Member   Joined: Dec 2007 Posts: 687 Thanks: 47 Re: Twin primes distributed around N mod 3 =0 the simple algorithm and the list: Code: forstep(x=1,10000,2,if(isprime(x),if(isprime(x+2),forstep(y=1,x-2,2,if(isprime(y),if(isprime(y-2),if(ispower(y+(x-y)/2+1,2),print(y-2":"y"--"x":"x+2" square="y+(x-y)/2+1)))))))) Code: 3:5--11:13 square=9 11:13--17:19 square=16 17:19--29:31 square=25 5:7--41:43 square=25 17:19--107:109 square=64 59:61--137:139 square=100 101:103--137:139 square=121 17:19--179:181 square=100 59:61--179:181 square=121 5:7--191:193 square=100 41:43--197:199 square=121 137:139--197:199 square=169 191:193--197:199 square=196 11:13--227:229 square=121 107:109--227:229 square=169 149:151--239:241 square=196 239:241--269:271 square=256 3:5--281:283 square=144 107:109--281:283 square=196 227:229--281:283 square=256 197:199--311:313 square=256 41:43--347:349 square=196 227:229--347:349 square=289 197:199--521:523 square=361 5:7--569:571 square=289 149:151--569:571 square=361 227:229--569:571 square=400 197:199--599:601 square=400 101:103--617:619 square=361 179:181--617:619 square=400 347:349--617:619 square=484 3:5--641:643 square=324 59:61--659:661 square=361 137:139--659:661 square=400 137:139--827:829 square=484 227:229--827:829 square=529 419:421--827:829 square=625 521:523--827:829 square=676 107:109--857:859 square=484 197:199--857:859 square=529 821:823--857:859 square=841 227:229--1019:1021 square=625 659:661--1019:1021 square=841 5:7--1049:1051 square=529 197:199--1049:1051 square=625 617:619--1061:1063 square=841 857:859--1061:1063 square=961 827:829--1091:1093 square=961 197:199--1151:1153 square=676 17:19--1229:1231 square=625 71:73--1277:1279 square=676 641:643--1277:1279 square=961 1031:1033--1277:1279 square=1156 59:61--1289:1291 square=676 1019:1021--1289:1291 square=1156 617:619--1301:1303 square=961 29:31--1319:1321 square=676 599:601--1319:1321 square=961 137:139--1427:1429 square=784 617:619--1427:1429 square=1024 881:883--1427:1429 square=1156 1019:1021--1427:1429 square=1225 3:5--1451:1453 square=729 227:229--1451:1453 square=841 857:859--1451:1453 square=1156 197:199--1481:1483 square=841 827:829--1481:1483 square=1156 191:193--1487:1489 square=841 431:433--1487:1489 square=961 821:823--1487:1489 square=1156 71:73--1607:1609 square=841 311:313--1607:1609 square=961 1277:1279--1607:1609 square=1444 59:61--1619:1621 square=841 827:829--1619:1621 square=1225 11:13--1667:1669 square=841 641:643--1667:1669 square=1156 347:349--1697:1699 square=1024 197:199--1721:1723 square=961 521:523--1787:1789 square=1156 659:661--1787:1789 square=1225 1487:1489--1871:1873 square=1681 41:43--1877:1879 square=961 431:433--1877:1879 square=1156 569:571--1877:1879 square=1225 857:859--1877:1879 square=1369 1319:1321--1877:1879 square=1600 1481:1483--1877:1879 square=1681 1427:1429--1931:1933 square=1681 311:313--1997:1999 square=1156 1697:1699--1997:1999 square=1849 1871:1873--1997:1999 square=1936 17:19--2027:2029 square=1024 281:283--2027:2029 square=1156 419:421--2027:2029 square=1225 857:859--2027:2029 square=1444 1667:1669--2027:2029 square=1849 227:229--2081:2083 square=1156 1277:1279--2081:2083 square=1681 1787:1789--2081:2083 square=1936 1607:1609--2087:2089 square=1849 197:199--2111:2113 square=1156 179:181--2129:2131 square=1156 1229:1231--2129:2131 square=1681 2087:2089--2141:2143 square=2116 71:73--2237:2239 square=1156 41:43--2267:2269 square=1156 179:181--2267:2269 square=1225 617:619--2267:2269 square=1444 1091:1093--2267:2269 square=1681 1427:1429--2267:2269 square=1849 137:139--2309:2311 square=1225 1049:1051--2309:2311 square=1681 107:109--2339:2341 square=1225 857:859--2339:2341 square=1600 1019:1021--2339:2341 square=1681 1487:1489--2381:2383 square=1936 809:811--2549:2551 square=1681 1319:1321--2549:2551 square=1936 1277:1279--2591:2593 square=1936 227:229--2657:2659 square=1444 2141:2143--2657:2659 square=2401 2339:2341--2657:2659 square=2500 197:199--2687:2689 square=1444 2111:2113--2687:2689 square=2401 2309:2311--2687:2689 square=2500 2087:2089--2711:2713 square=2401 5:7--2729:2731 square=1369 2267:2269--2729:2731 square=2500 569:571--2789:2791 square=1681 1427:1429--2801:2803 square=2116 1997:1999--2801:2803 square=2401 227:229--2969:2971 square=1600 2027:2029--2969:2971 square=2500 197:199--2999:3001 square=1600 1229:1231--2999:3001 square=2116 1997:1999--2999:3001 square=2500 239:241--3119:3121 square=1681 1877:1879--3119:3121 square=2500 29:31--3167:3169 square=1600 191:193--3167:3169 square=1681 1061:1063--3167:3169 square=2116 2237:2239--3167:3169 square=2704 107:109--3251:3253 square=1681 617:619--3251:3253 square=1936 101:103--3257:3259 square=1681 2789:2791--3257:3259 square=3025 59:61--3299:3301 square=1681 569:571--3299:3301 square=1936 1697:1699--3299:3301 square=2500 2969:2971--3299:3301 square=3136 29:31--3329:3331 square=1681 1667:1669--3329:3331 square=2500 2687:2689--3359:3361 square=3025 857:859--3371:3373 square=2116 1427:1429--3371:3373 square=2401 1607:1609--3389:3391 square=2500 2657:2659--3389:3391 square=3025 227:229--3467:3469 square=1849 2801:2803--3467:3469 square=3136 3257:3259--3467:3469 square=3364 1877:1879--3527:3529 square=2704 2087:2089--3527:3529 square=2809 2729:2731--3539:3541 square=3136 137:139--3557:3559 square=1849 311:313--3557:3559 square=1936 857:859--3557:3559 square=2209 2711:2713--3557:3559 square=3136 3167:3169--3557:3559 square=3364 2687:2689--3581:3583 square=3136 197:199--3671:3673 square=1936 101:103--3767:3769 square=1936 461:463--3767:3769 square=2116 1031:1033--3767:3769 square=2401 1229:1231--3767:3769 square=2500 3671:3673--3767:3769 square=3721 17:19--3851:3853 square=1936 311:313--3917:3919 square=2116 881:883--3917:3919 square=2401 1487:1489--3917:3919 square=2704 1697:1699--3917:3919 square=2809 2129:2131--3917:3919 square=3025 3767:3769--3917:3919 square=3844 2339:2341--3929:3931 square=3136 227:229--4001:4003 square=2116 2267:2269--4001:4003 square=3136 2027:2029--4019:4021 square=3025 179:181--4049:4051 square=2116 1997:1999--4049:4051 square=3025 3389:3391--4049:4051 square=3721 137:139--4091:4093 square=2116 101:103--4127:4129 square=2116 1277:1279--4127:4129 square=2704 1487:1489--4127:4129 square=2809 2141:2143--4127:4129 square=3136 3557:3559--4127:4129 square=3844 71:73--4157:4159 square=2116 641:643--4157:4159 square=2401 2111:2113--4157:4159 square=3136 2801:2803--4157:4159 square=3481 3527:3529--4157:4159 square=3844 11:13--4217:4219 square=2116 197:199--4217:4219 square=2209 3467:3469--4217:4219 square=3844 569:571--4229:4231 square=2401 2729:2731--4229:4231 square=3481 4217:4219--4229:4231 square=4225 2027:2029--4241:4243 square=3136 1787:1789--4259:4261 square=3025 3929:3931--4259:4261 square=4096 1997:1999--4271:4273 square=3136 2687:2689--4271:4273 square=3481 3167:3169--4271:4273 square=3721 3917:3919--4271:4273 square=4096 461:463--4337:4339 square=2401 659:661--4337:4339 square=2500 1277:1279--4337:4339 square=2809 1931:1933--4337:4339 square=3136 3851:3853--4337:4339 square=4096 3767:3769--4421:4423 square=4096 1787:1789--4481:4483 square=3136 281:283--4517:4519 square=2401 3167:3169--4517:4519 square=3844 3671:3673--4517:4519 square=4096 3929:3931--4517:4519 square=4225 857:859--4547:4549 square=2704 1721:1723--4547:4549 square=3136 2087:2089--4637:4639 square=3364 2801:2803--4637:4639 square=3721 4337:4339--4637:4639 square=4489 149:151--4649:4651 square=2401 347:349--4649:4651 square=2500 1619:1621--4649:4651 square=3136 2309:2311--4649:4651 square=3481 2789:2791--4649:4651 square=3721 3539:3541--4649:4651 square=4096 2237:2239--4721:4723 square=3481 3467:3469--4721:4723 square=4096 11:13--4787:4789 square=2401 617:619--4787:4789 square=2704 827:829--4787:4789 square=2809 1481:1483--4787:4789 square=3136 197:199--4799:4801 square=2500 3389:3391--4799:4801 square=4096 2027:2029--4931:4933 square=3481 3257:3259--4931:4933 square=4096 29:31--4967:4969 square=2500 1301:1303--4967:4969 square=3136 1949:1951--5009:5011 square=3481 4787:4789--5009:5011 square=4900 3167:3169--5021:5023 square=4096 2339:2341--5099:5101 square=3721 3167:3169--5279:5281 square=4225 4517:4519--5279:5281 square=4900 4799:4801--5279:5281 square=5041 197:199--5417:5419 square=2809 2267:2269--5417:5419 square=3844 3557:3559--5417:5419 square=4489 827:829--5441:5443 square=3136 1997:1999--5441:5443 square=3721 4637:4639--5441:5443 square=5041 137:139--5477:5479 square=2809 569:571--5477:5479 square=3025 1481:1483--5477:5479 square=3481 2711:2713--5477:5479 square=4096 2969:2971--5477:5479 square=4225 3767:3769--5477:5479 square=4624 2687:2689--5501:5503 square=4096 1319:1321--5639:5641 square=3481 2549:2551--5639:5641 square=4096 4157:4159--5639:5641 square=4900 617:619--5651:5653 square=3136 1787:1789--5651:5653 square=3721 1301:1303--5657:5659 square=3481 2027:2029--5657:5659 square=3844 2789:2791--5657:5659 square=4225 4421:4423--5657:5659 square=5041 1697:1699--5741:5743 square=3721 4337:4339--5741:5743 square=5041 197:199--5849:5851 square=3025 419:421--5849:5851 square=3136 2339:2341--5849:5851 square=4096 4229:4231--5849:5851 square=5041 5099:5101--5849:5851 square=5476 179:181--5867:5869 square=3025 857:859--5867:5869 square=3364 1091:1093--5867:5869 square=3481 3929:3931--5867:5869 square=4900 4787:4789--5867:5869 square=5329 2309:2311--5879:5881 square=4096 3917:3919--5879:5881 square=4900 179:181--6089:6091 square=3136 137:139--6131:6133 square=3136 827:829--6131:6133 square=3481 5417:5419--6131:6133 square=5776 71:73--6197:6199 square=3136 1487:1489--6197:6199 square=3844 5657:5659--6197:6199 square=5929 3527:3529--6269:6271 square=4900 5279:5281--6269:6271 square=5776 659:661--6299:6301 square=3481 4649:4651--6299:6301 square=5476 599:601--6359:6361 square=3481 2087:2089--6359:6361 square=4225 1997:1999--6449:6451 square=4225 5099:5101--6449:6451 square=5776 3527:3529--6551:6553 square=5041 1619:1621--6569:6571 square=4096 1877:1879--6569:6571 square=4225 1787:1789--6659:6661 square=4225 269:271--6689:6691 square=3481 3389:3391--6689:6691 square=5041 4259:4261--6689:6691 square=5476 1487:1489--6701:6703 square=4096 197:199--6761:6763 square=3481 1427:1429--6761:6763 square=4096 4787:4789--6761:6763 square=5776 179:181--6779:6781 square=3481 659:661--6779:6781 square=3721 1667:1669--6779:6781 square=4225 3299:3301--6779:6781 square=5041 4157:4159--6791:6793 square=5476 857:859--6827:6829 square=3844 1619:1621--6827:6829 square=4225 2969:2971--6827:6829 square=4900 3251:3253--6827:6829 square=5041 4721:4723--6827:6829 square=5776 5651:5653--6827:6829 square=6241 569:571--6869:6871 square=3721 1319:1321--6869:6871 square=4096 11:13--6947:6949 square=3481 2027:2029--6947:6949 square=4489 4001:4003--6947:6949 square=5476 5849:5851--6947:6949 square=6400 6827:6829--6947:6949 square=6889 1229:1231--6959:6961 square=4096 1487:1489--6959:6961 square=4225 3119:3121--6959:6961 square=5041 5519:5521--6959:6961 square=6241 311:313--7127:7129 square=3721 1061:1063--7127:7129 square=4096 1319:1321--7127:7129 square=4225 3527:3529--7127:7129 square=5329 3821:3823--7127:7129 square=5476 4421:4423--7127:7129 square=5776 227:229--7211:7213 square=3721 4337:4339--7211:7213 square=5776 881:883--7307:7309 square=4096 1667:1669--7307:7309 square=4489 4241:4243--7307:7309 square=5776 4547:4549--7307:7309 square=5929 107:109--7331:7333 square=3721 857:859--7331:7333 square=4096 4217:4219--7331:7333 square=5776 2729:2731--7349:7351 square=5041 227:229--7457:7459 square=3844 1787:1789--7457:7459 square=4624 2339:2341--7457:7459 square=4900 4091:4093--7457:7459 square=5776 5021:5023--7457:7459 square=6241 7331:7333--7457:7459 square=7396 197:199--7487:7489 square=3844 1487:1489--7487:7489 square=4489 2309:2311--7487:7489 square=4900 2591:2593--7487:7489 square=5041 3167:3169--7487:7489 square=5329 3461:3463--7487:7489 square=5476 6959:6961--7487:7489 square=7225 137:139--7547:7549 square=3844 641:643--7547:7549 square=4096 1427:1429--7547:7549 square=4489 1697:1699--7547:7549 square=4624 4001:4003--7547:7549 square=5776 4931:4933--7547:7549 square=6241 2237:2239--7559:7561 square=4900 3389:3391--7559:7561 square=5476 599:601--7589:7591 square=4096 857:859--7589:7591 square=4225 3359:3361--7589:7591 square=5476 431:433--7757:7759 square=4096 1487:1489--7757:7759 square=4624 4721:4723--7757:7759 square=6241 6689:6691--7757:7759 square=7225 311:313--7877:7879 square=4096 569:571--7877:7879 square=4225 3671:3673--7877:7879 square=5776 6569:6571--7877:7879 square=7225 239:241--7949:7951 square=4096 2129:2131--7949:7951 square=5041 2999:3001--7949:7951 square=5476 179:181--8009:8011 square=4096 1787:1789--8009:8011 square=4900 3539:3541--8009:8011 square=5776 4787:4789--8009:8011 square=6400 6779:6781--8009:8011 square=7396 101:103--8087:8089 square=4096 3461:3463--8087:8089 square=5776 3767:3769--8087:8089 square=5929 6359:6361--8087:8089 square=7225 6701:6703--8087:8089 square=7396 227:229--8219:8221 square=4225 2729:2731--8219:8221 square=5476 3329:3331--8219:8221 square=5776 4259:4261--8219:8221 square=6241 6569:6571--8219:8221 square=7396 1787:1789--8291:8293 square=5041 2657:2659--8291:8293 square=5476 3257:3259--8291:8293 square=5776 7547:7549--8291:8293 square=7921 59:61--8387:8389 square=4225 857:859--8387:8389 square=4624 2267:2269--8387:8389 square=5329 3467:3469--8387:8389 square=5929 4091:4093--8387:8389 square=6241 17:19--8429:8431 square=4225 3119:3121--8429:8431 square=5776 4049:4051--8429:8431 square=6241 6359:6361--8429:8431 square=7396 4259:4261--8537:8539 square=6400 6947:6949--8537:8539 square=7744 8387:8389--8537:8539 square=8464 1481:1483--8597:8599 square=5041 3257:3259--8597:8599 square=5929 5849:5851--8597:8599 square=7225 347:349--8627:8629 square=4489 617:619--8627:8629 square=4624 1451:1453--8627:8629 square=5041 2027:2029--8627:8629 square=5329 3851:3853--8627:8629 square=6241 7211:7213--8627:8629 square=7921 2129:2131--8819:8821 square=5476 2729:2731--8819:8821 square=5776 137:139--8837:8839 square=4489 2111:2113--8837:8839 square=5476 2711:2713--8837:8839 square=5776 8087:8089--8837:8839 square=8464 2087:2089--8861:8863 square=5476 2687:2689--8861:8863 square=5776 5:7--8969:8971 square=4489 827:829--8969:8971 square=4900 5477:5479--8969:8971 square=7225 6869:6871--8969:8971 square=7921 7589:7591--8969:8971 square=8281 1949:1951--8999:9001 square=5476 2549:2551--8999:9001 square=5776 7559:7561--8999:9001 square=8281 3467:3469--9011:9013 square=6241 6827:6829--9011:9013 square=7921 7547:7549--9011:9013 square=8281 8627:8629--9041:9043 square=8836 5:7--9239:9241 square=4624 2309:2311--9239:9241 square=5776 3557:3559--9239:9241 square=6400 8429:8431--9239:9241 square=8836 1667:1669--9281:9283 square=5476 2267:2269--9281:9283 square=5776 8387:8389--9281:9283 square=8836 1607:1609--9341:9343 square=5476 659:661--9419:9421 square=5041 2129:2131--9419:9421 square=5776 8627:8629--9419:9421 square=9025 7127:7129--9431:9433 square=8281 641:643--9437:9439 square=5041 2111:2113--9437:9439 square=5776 3359:3361--9437:9439 square=6400 4337:4339--9437:9439 square=6889 5009:5011--9437:9439 square=7225 7487:7489--9437:9439 square=8464 8231:8233--9437:9439 square=8836 617:619--9461:9463 square=5041 1487:1489--9461:9463 square=5476 2087:2089--9461:9463 square=5776 1319:1321--9629:9631 square=5476 3167:3169--9629:9631 square=6400 1871:1873--9677:9679 square=5776 2801:2803--9677:9679 square=6241 3119:3121--9677:9679 square=6400 3767:3769--9677:9679 square=6724 1229:1231--9719:9721 square=5476 7949:7951--9719:9721 square=8836 29:31--9767:9769 square=4900 311:313--9767:9769 square=5041 2087:2089--9767:9769 square=5929 2711:2713--9767:9769 square=6241 5021:5023--9767:9769 square=7396 6791:6793--9767:9769 square=8281 9437:9439--9767:9769 square=9604 1091:1093--9857:9859 square=5476 1997:1999--9857:9859 square=5929 3917:3919--9857:9859 square=6889 4931:4933--9857:9859 square=7396 6701:6703--9857:9859 square=8281 149:151--9929:9931 square=5041 1019:1021--9929:9931 square=5476 1619:1621--9929:9931 square=5776 2549:2551--9929:9931 square=6241 4517:4519--9929:9931 square=7225
February 19th, 2011, 10:27 PM   #5
Global Moderator

Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Twin primes distributed around N mod 3 =0

Quote:
 Originally Posted by Agno I started by postulating that all pairs of twin primes are equidistant around $n^2$ mod 3 = 0.
What you're literally claiming is obviously false -- there are infinitely many primes above a number but only finitely many below. So what did you actually mean by this?

Quote:
 Originally Posted by Agno Didn't get much further with that, but with some good help we could potentially prove a weaker version of the postulate and that is: IF two pairs of twin primes (except the first pair 3,5) are equidistant around N (not necessarily a square), then N mod 3 MUST be 0.
Your terminology is nonstandard, but what you mean directly follows from the fact that twin primes are of the form 6n +/- 1. (Excluding 3,5 of course -- in fact I'll exclude it from now on.)

Quote:
 Originally Posted by Agno This poses the inverse question whether all N mod 3 = 0 also have two equidistant pairs of twin primes?
It's virtually certain that there are only finitely many exceptions. The twin primes are a fairly 'thick' sequence, being of (conjectural) density n/log^2 n; adding them to themselves should give almost all numbers not excluded by modular considerations.

February 19th, 2011, 10:36 PM   #6
Global Moderator

Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Twin primes distributed around N mod 3 =0

Quote:
 Originally Posted by al-mahed the simple algorithm and the list: Code: forstep(x=1,10000,2,if(isprime(x),if(isprime(x+2),forstep(y=1,x-2,2,if(isprime(y),if(isprime(y-2),if(ispower(y+(x-y)/2+1,2),print(y-2":"y"--"x":"x+2" square="y+(x-y)/2+1))))))))
Rather than looping through the odd numbers and testing if they're prime, loop over the primes directly:
Code:
forprime(x=3,100000,if(isprime(x+2),forprime(y=5,x-2,if(isprime(y-2)&&issquare(y+(x-y)/2+1),print(y-2":"y"--"x":"x+2" square="y+(x-y)/2+1)))))
This is much faster -- 6x faster in this case but it can get larger when the numbers are increased.

I also changed ispower(__, 2) to issquare(__) and if(__, if(__, __)) to if(__ && __, __) but those are mostly for readability; there's no particular performance difference.

February 20th, 2011, 04:07 AM   #7
Senior Member

Joined: Jan 2011

Posts: 120
Thanks: 2

Re: Twin primes distributed around N mod 3 =0

Quote:
Originally Posted by CRGreathouse
Quote:
 Originally Posted by Agno I started by postulating that all pairs of twin primes are equidistant around $n^2$ mod 3 = 0.
What you're literally claiming is obviously false -- there are infinitely many primes above a number but only finitely many below. So what did you actually mean by this?
What I meant was that all pairs of twin primes (except the first pair 3,5) are equidistant around $n^2$, and that this $n^2$ always is a multiple of 3. So each twin pair $n^2 - k$ always has an equidistant twin pair $n^2 + k$.

Examples:
* 5,7 en 11,13 ($3^2$, distance 2)
* 29,31 en 41,43 ($6^2$, distance 5)
* 59,61 en 101,103 ($9^2$, distance 20)
* 17,19 en 269, 271 ($12^2$, distance 125)

We tested a part of this conjecture ((i.e. that all squares mod 3 =0 always have at least 1 equidistant set of twin prime pairs around them, which does not imply that all twin prime pairs are 'touched') up to n = 1.000.000.000, and found no exceptions . So, indeed the density of twin primes seems such that they always 'circle' around a square mod 3 =0.

Few results:
Largest distance is (26646^2):
710009316: Twins (709837241,709837243) and (710181389,710181391) Distance: 172073 (ratio around 1/4126)

There are also still very small equidistances for very large squares:
640798596: Twins (640798589,640798591) and (640798601,640798603) Distance: 5
680114241: Twins (680114231,680114233) and (680114249,680114251) Distance: 8

Quote:
Originally Posted by CRGreathouse
Quote:
 Originally Posted by Agno Didn't get much further with that, but with some good help we could potentially prove a weaker version of the postulate and that is: IF two pairs of twin primes (except the first pair 3,5) are equidistant around N (not necessarily a square), then N mod 3 MUST be 0.
Your terminology is nonstandard, but what you mean directly follows from the fact that twin primes are of the form 6n +/- 1. (Excluding 3,5 of course -- in fact I'll exclude it from now on.)
Correct.

Quote:
Originally Posted by CRGreathouse
Quote:
 Originally Posted by Agno This poses the inverse question whether all N mod 3 = 0 also have two equidistant pairs of twin primes?
It's virtually certain that there are only finitely many exceptions. The twin primes are a fairly 'thick' sequence, being of (conjectural) density n/log^2 n; adding them to themselves should give almost all numbers not excluded by modular considerations.
If we could only prove that the density of twin primes is indeed such that no further exceptions can exist, since then the twin prime conjecture would also be proven...

 February 20th, 2011, 07:18 AM #8 Senior Member   Joined: Dec 2007 Posts: 687 Thanks: 47 Re: Twin primes distributed around N mod 3 =0 Charles! Thank you for the hint! Agno, is trivial that n will be always divisible by 3 since in each pair of twins the smallest of them is of the form 3x+2 (if not, the bigger would be divisible by 3), as I posted, you don't need to check it. The ONLY exception will be the pair 3, 5. That p is of the form 3x+2 is clear because, if not, if it were of the form 3x+1, then $p+2=q=3x+3=3(x+1)$ would be divisible by 3 so either p = 3 or p= 3x+2, since p=3 is not interesting here, we are daling with $p=3x+2$ and$q=3y+1,\ p\ a\equiv\ 2 \pmod{3}\==>\ a+1\equiv\ 0 \pmod{3}=$ QED.
February 20th, 2011, 07:45 AM   #9
Senior Member

Joined: Jan 2011

Posts: 120
Thanks: 2

Re: Twin primes distributed around N mod 3 =0

Quote:
 Originally Posted by al-mahed Charles! Thank you for the hint! Agno, is trivial that n will be always divisible by 3 since in each pair of twins the smallest of them is of the form 3x+2 (if not, the bigger would be divisible by 3), as I posted, you don't need to check it. The ONLY exception will be the pair 3, 5. That p is of the form 3x+2 is clear because, if not, if it were of the form 3x+1, then $p+2=q=3x+3=3(x+1)$ would be divisible by 3 so either p = 3 or p= 3x+2, since p=3 is not interesting here, we are daling with $p=3x+2$ and$q=3y+1,\ p\ a\equiv\ 2 \pmod{3}\==>\ a+1\equiv\ 0 \pmod{3}=$ QED.
al-mahed,

Got it. Many thanks for your clear explanation!

 Tags distributed, mod, primes, twin

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post caters Number Theory 67 March 19th, 2014 04:32 PM mathbalarka Math Software 6 August 22nd, 2012 10:19 AM mathbalarka Number Theory 8 August 6th, 2012 05:55 AM loes Number Theory 1 March 22nd, 2012 08:28 AM marlen19861 Number Theory 1 November 5th, 2008 12:35 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top