mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Prime Gap Searches

Reply
 
Thread Tools
Old 2018-07-29, 15:23   #34
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

22×3×491 Posts
Default

Quote:
Originally Posted by Bobby Jacobs View Post
We should try primes mod n for different values of n.
OK, I tried a couple -- the n's with

\varphi(n)=2.

(BTW, I disregard the prime factors of n.)

For n = 4, the first odd prime is p = 3, so the residue class 3 mod 4 takes an early lead. It keeps it for some time:
Code:
? v=vector(2);forprime(p=3,100000,r=p%4;if(r==1,v[1]++,v[2]++);if(v[1]>v[2],print(p" "v);break))
26861 [1473, 1472]
For n = 6, the first prime not dividing 6 is 5, so the residue class 5 mod 6 takes an early lead. I checked up to 2^31, and up to that limit, 1 (mod 6) had yet to depose it.

EDIT: According to Prime Races [which I recommend reading], 1 mod 6 doesn't take the lead until

p = 608,981,813,029.

Last fiddled with by Dr Sardonicus on 2018-07-29 at 15:48
Dr Sardonicus is offline   Reply With Quote
Old 2018-07-29, 16:20   #35
rudy235
 
rudy235's Avatar
 
Jun 2015
Vallejo, CA/.

21418 Posts
Default

Looking at the curios for 1867, I find nothing truly remarkable. Nothing like the "taxicab number".

There are only 1867 different summing equalities for numbers 1 to 11 where no value is used more than once: 1+2=3, 1+3=4, 2+3=1+4, etc.

1867 is the smallest prime that can be expressed as the sum of distinct Fibonacci numbers in 42 different ways.

1867 is the smallest prime that is the sum of 44 consecutive composite numbers: 1867 = 14 + 15 + 16 + 18 + 20 + ... + 68 + 69 + 70.

1867 = 284th prime + 284th composite: 1867 = 1559 + 308.

Concatenating the prime previous to 1867 with itself, is prime, i.e., 18611867 is prime.

In this emirp year the Dominion of Canada was created by an act of the British Parliament.
rudy235 is offline   Reply With Quote
Old 2018-07-29, 16:52   #36
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

2,039 Posts
Default

Quote:
Originally Posted by Bobby Jacobs View Post
We should try primes mod n for different values of n.
Granville and Martin (2006) is an important read as mentioned by Dr Sardonicus.

I'm checking mod2310 up to 5e10 tonight, and will rewrite my program to allow continuation rather than starting from scratch.

Here is the perl code I am using. To change the mod value just change 2310 to the relevant value.

Code:
#!/usr/bin/env perl
use warnings;
use strict;
use Timer::Runtime;
use Math::Prime::Util qw/:all/;
use List::Util qw(min max);

$|=1;

my $beg = 1;
my $end = 50_000_000_000;
my @results = my @arr = (0)x2310;

forprimes {my $modresult = $_%2310;
my $maximum = max @results;
$results[$modresult]=$results[$modresult]+1; 
if ($results[$modresult] > $maximum) {
print "$_ $modresult $results[$modresult]\n" 
}
  
} $beg, $end;

print "@results\n";

Last fiddled with by robert44444uk on 2018-07-29 at 16:59
robert44444uk is offline   Reply With Quote
Old 2018-07-29, 19:41   #37
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

2,039 Posts
Default

Panic

I managed to bust the computer! It got to just over 10bn and then the program told me I had a memory wrap, whatever that is.

Anyways, at 10bn, the leader was 1753, which took over from 1039 at 8984371819. Other regular leaders were 617, 601, 2029, 179, 2201 and, of course, 1867.
robert44444uk is offline   Reply With Quote
Old 2018-07-30, 14:23   #38
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

32·101 Posts
Default

Quote:
Originally Posted by robert44444uk View Post
Panic

I managed to bust the computer! It got to just over 10bn and then the program told me I had a memory wrap, whatever that is.

Anyways, at 10bn, the leader was 1753, which took over from 1039 at 8984371819. Other regular leaders were 617, 601, 2029, 179, 2201 and, of course, 1867.
Interesting. I wonder if this could be because of memory issues with "my" inside the forprimes. If you are still playing with it, use "my($modresult,$maximum);" outside the prime loop, and remove the "my " from inside the loop. It's at 20 billion for me now and still running.

It runs about 2x faster for me using "vecmax" instead of List::Util's "max".

But just setting the new maximum inside the if statement is vastly faster than either. max / vecmax of an array is very expensive compared to the other work.
danaj is offline   Reply With Quote
Old 2018-07-30, 16:27   #39
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

2,039 Posts
Default

Quote:
Originally Posted by danaj View Post
Interesting. I wonder if this could be because of memory issues with "my" inside the forprimes. If you are still playing with it, use "my($modresult,$maximum);" outside the prime loop, and remove the "my " from inside the loop. It's at 20 billion for me now and still running.

It runs about 2x faster for me using "vecmax" instead of List::Util's "max".

But just setting the new maximum inside the if statement is vastly faster than either. max / vecmax of an array is very expensive compared to the other work.
danaj, as always, we would be grateful if you could post your code here.

I did a few tweaks to make sure it did not crash, and got to 10bn. The spread of primes for the permissable values was very interesting! Much wider than I had anticipated. Over 2500 (0.265%)

Code:
1753	949266
1039	949155
617	948905
2111	948867
1109	948801
1093	948784
179	948761
349	948755
503	948753
949	948722
593	948715
607	948684
1663	948673
2029	948668
467	948649
703	948649
223	948646
247	948646
1637	948638
251	948634
701	948627
761	948625
1403	948624
1643	948620
563	948617
1523	948614
1889	948601
1747	948600
1931	948587
67	948586
151	948584
2071	948568
431	948555
971	948554
229	948551
1367	948536
2069	948532
1327	948522
2039	948521
643	948517
1427	948517
601	948512
1847	948512
1369	948509
2119	948507
409	948502
1357	948502
191	948499
1499	948489
2131	948486
2213	948485
1139	948484
1033	948480
541	948479
1997	948475
551	948467
1429	948467
1891	948464
53	948463
61	948460
2201	948454
1571	948453
1927	948447
1877	948433
691	948425
307	948423
1933	948423
1783	948418
727	948411
499	948405
461	948400
577	948398
2141	948395
1297	948392
331	948389
2129	948388
2249	948388
2171	948382
377	948377
1619	948373
1457	948366
347	948364
1087	948363
673	948357
683	948357
2203	948357
2161	948356
59	948355
953	948355
19	948350
1553	948350
521	948334
751	948333
1777	948327
283	948326
773	948326
1069	948325
997	948313
1019	948313
767	948312
2291	948306
47	948304
1003	948294
1363	948290
821	948289
877	948287
1021	948286
1819	948285
1129	948283
1451	948282
1027	948280
653	948279
1919	948279
589	948278
1051	948277
2041	948277
1487	948275
173	948274
1219	948272
1013	948270
1921	948270
677	948269
1259	948269
779	948265
2227	948265
1061	948264
1817	948264
1283	948261
1481	948261
1423	948260
383	948257
743	948257
1453	948257
899	948256
403	948251
2113	948248
1321	948244
1469	948242
1289	948240
619	948238
1787	948234
1811	948233
1339	948230
1091	948229
2257	948224
2297	948224
817	948223
1657	948220
719	948214
1949	948214
107	948210
197	948208
2237	948204
293	948203
1711	948203
1649	948201
13	948199
659	948196
1349	948193
1313	948189
479	948178
1733	948177
1957	948176
1147	948175
1513	948174
533	948173
83	948168
2287	948167
43	948166
2047	948164
2281	948164
139	948160
1307	948156
257	948149
1763	948149
457	948146
1229	948146
353	948145
1121	948139
1381	948137
1853	948136
1193	948135
313	948133
1081	948133
1319	948129
1471	948129
373	948126
137	948122
1913	948118
661	948115
2267	948115
2153	948113
401	948112
1117	948111
1247	948110
731	948105
1159	948105
323	948104
1181	948104
1961	948103
2183	948103
389	948098
2231	948098
103	948093
1123	948090
1261	948090
1681	948090
1723	948090
487	948089
769	948089
1633	948088
2239	948088
1201	948087
1189	948085
2251	948084
1579	948079
1717	948077
2159	948075
941	948073
733	948072
29	948071
239	948071
1607	948070
1343	948067
2011	948067
1031	948057
1973	948056
851	948055
977	948051
167	948047
1249	948046
853	948045
337	948043
1493	948042
689	948039
127	948037
1361	948035
437	948031
923	948028
1517	948025
811	948024
1613	948020
1801	948018
613	948017
1849	948017
71	948014
509	948014
1577	948014
647	948006
227	948004
2309	948004
163	948000
241	947999
793	947999
1079	947998
1627	947998
1979	947998
2087	947997
1867	947991
827	947988
199	947987
911	947987
299	947985
1937	947981
1999	947978
857	947976
569	947974
1907	947973
113	947972
1987	947970
2003	947966
1273	947963
2273	947962
1781	947960
1103	947959
1873	947959
1417	947958
1151	947957
871	947953
73	947950
1993	947949
493	947948
1511	947948
1537	947948
2179	947948
1879	947943
1721	947937
547	947933
1739	947931
1483	947926
1489	947925
2053	947925
611	947924
799	947918
367	947916
379	947916
1759	947912
1409	947911
1333	947908
991	947906
1073	947905
233	947904
559	947904
527	947902
859	947900
1909	947900
1963	947899
1831	947897
463	947896
839	947896
989	947896
1609	947894
919	947890
221	947889
1291	947888
863	947880
1303	947873
1213	947871
289	947870
23	947868
641	947861
1697	947859
157	947854
787	947852
2207	947848
739	947844
1439	947839
2197	947838
557	947837
709	947837
1769	947836
2021	947835
2221	947835
271	947827
1217	947825
1063	947824
491	947819
2081	947818
211	947816
961	947813
1679	947813
1373	947812
757	947809
1277	947807
1157	947806
421	947803
1241	947803
1501	947802
2143	947801
1829	947800
2099	947798
361	947797
1399	947796
823	947795
2137	947794
481	947792
277	947790
1387	947790
1009	947789
1943	947789
1207	947788
2117	947787
1597	947781
89	947780
523	947771
1447	947771
2017	947770
2209	947770
391	947767
449	947762
943	947759
109	947755
397	947753
101	947749
983	947749
1807	947747
1871	947747
2059	947743
1237	947739
31	947734
1433	947733
1691	947729
2027	947726
929	947720
17	947711
149	947711
2173	947710
2263	947707
1667	947705
1843	947695
1223	947692
1271	947692
2147	947689
439	947687
1171	947681
2033	947675
1601	947661
2089	947658
1459	947653
41	947643
317	947642
967	947642
1693	947642
2279	947640
1187	947639
1097	947637
1531	947636
797	947632
1049	947630
901	947626
79	947622
829	947622
1591	947622
907	947618
947	947618
2077	947617
131	947606
433	947602
841	947602
571	947592
697	947591
887	947589
169	947587
809	947587
1699	947586
181	947580
263	947578
2293	947577
881	947576
1411	947572
1583	947570
713	947563
937	947560
1621	947560
1901	947557
1741	947556
1037	947547
1951	947541
443	947539
1543	947534
1163	947533
193	947532
359	947527
1751	947524
1391	947515
2083	947508
1153	947497
1559	947488
1301	947485
1789	947481
1549	947470
1861	947466
893	947459
311	947458
1703	947452
1231	947447
2269	947440
629	947436
1567	947420
631	947406
1007	947406
883	947390
1541	947380
667	947373
37	947360
1279	947358
599	947351
1709	947343
2063	947320
2243	947308
1669	947299
587	947283
419	947278
1651	947234
1823	947234
281	947205
269	947188
97	947183
529	946757
2	1
3	1
5	1
7	1
11	1
robert44444uk is offline   Reply With Quote
Old 2018-07-30, 17:32   #40
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

32×101 Posts
Default

Produces similar output to what you showed, about 50 seconds on my macbook.

Code:
#!/usr/bin/env perl
use warnings;
use strict;
use Timer::Runtime;
use Math::Prime::Util qw/:all/;

$|=1;

my $beg = 1;
my $end = 10_000_000_000;
my @results = my @arr = (0)x2310;
my($modresult,$maximum) = (0,0);

forprimes {
  $modresult = $_ % 2310;
  $results[$modresult]++;
  if ($results[$modresult] > $maximum) {
    #print "$_ $modresult $results[$modresult]\n";
    $maximum = $results[$modresult];
  }
} $beg, $end;


print "$_\t$results[$_]\n" for
   sort { $results[$b] <=> $results[$a] }
   grep { $results[$_] > 0 }
   0..2309;
danaj is offline   Reply With Quote
Old 2018-07-30, 17:47   #41
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

2,039 Posts
Default

Quote:
Originally Posted by danaj View Post
Produces similar output to what you showed, about 50 seconds on my macbook.
As against 2.5 hours with my code!! The output file is quite large, and we only really need to record when the champion changes rather than when the $maximum increases.

For technical reasons it might be worth recording if there are mods that are equal to the champion, as I would like to try to show that all permissible mod results will be champions at some stage.

Last fiddled with by robert44444uk on 2018-07-30 at 17:50
robert44444uk is offline   Reply With Quote
Old 2018-07-30, 22:28   #42
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

3,347 Posts
Default

Quote:
Originally Posted by robert44444uk View Post
As against 2.5 hours with my code!! The output file is quite large, and we only really need to record when the champion changes rather than when the $maximum increases.

For technical reasons it might be worth recording if there are mods that are equal to the champion, as I would like to try to show that all permissible mod results will be champions at some stage.
I do not really use Perl, but maybe this will work, using an extra maxmod variable. Also included mods that are equal to the champion:


Code:
#!/usr/bin/env perl
use warnings;
use strict;
use Timer::Runtime;
use Math::Prime::Util qw/:all/;

$|=1;

my $beg = 1;
my $end = 10_000_000_000;
my @results = my @arr = (0)x2310;
my($modresult,$maximum) = (0,0);
my $maxmod = 0;

forprimes {
  $modresult = $_ % 2310;
  $results[$modresult]++;
  if ($results[$modresult] >= $maximum) {
    $maximum = $results[$modresult];
    if ($modresult!=$maxmod) {
      #print "$_ $modresult $results[$modresult]\n";
      $maxmod = $modresult;
    }
  }
} $beg, $end;


print "$_\t$results[$_]\n" for
   sort { $results[$b] <=> $results[$a] }
   grep { $results[$_] > 0 }
   0..2309;
ATH is offline   Reply With Quote
Old 2018-07-30, 22:41   #43
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

32×101 Posts
Default

Quote:
Originally Posted by ATH View Post
I do not really use Perl, but maybe this will work, using an extra maxmod variable. Also included mods that are equal to the champion:
That's pretty much what I was thinking. It's still a lot of back-and-forth output when transitioning from one to another, and I believe we skip the final output if we cared. But much better in quantity than before. We want to uncomment the actual print line now that the output is more reasonable.
danaj is offline   Reply With Quote
Old 2018-07-30, 22:51   #44
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

3,347 Posts
Default

Including the mods equal to the maximum creates a lot of spam in the beginning.
ATH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with probability distribution. Unregistered Information & Answers 13 2011-07-15 15:12
Distribution of matrix nonzeros jasonp Factoring 2 2010-11-08 13:34
exponential distribution davieddy Puzzles 10 2010-05-25 03:43
LLR Version 3.7.1c distribution Jean Penné Software 49 2008-04-30 17:13
What is the probability distribution for M42 ? dsouza123 Math 2 2004-06-02 02:16

All times are UTC. The time now is 22:34.


Tue Aug 9 22:34:25 UTC 2022 up 33 days, 17:21, 1 user, load averages: 1.05, 1.21, 1.18

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔