A275013
Lower ends of record gaps between numbers that are either primes or semiprimes.
Original entry on oeis.org
2, 7, 26, 97, 241, 2521, 16022, 26603, 39343, 104659, 248407, 506509, 584213, 2560177, 4036967, 4417813, 5167587, 9725107, 25045771, 27489679, 70416259, 111555371, 174266683, 359589563, 1075714923, 6820213333, 15378035161, 16598109467, 19423306039, 30133946677, 74466436042
Offset: 1
a(5) = 241 because the next prime or semiprime after 241 is 247, and that is a record gap of size 6.
-
r=0; last=2; for(n=3,1e9, if(bigomega(n)<3, if(n-last>r, r=n-last; print1(last", ")); last=n)) \\ Charles R Greathouse IV, Nov 12 2016
-
checkrange(a,b,r)=while(b-a>r, forstep(n=a+r, a+1, -1, if(bigomega(n)<3, a=n; next(2))); for(n=a+r+1,b, if(bigomega(n)<3, return([a,n])))); 0
print1(2); p=5; r=1; forprime(q=7,1e9, if(q-p<=r, p=q; next); t=checkrange(p,q,r); while(t!=0, print1(", "t[1]); t=checkrange(t[2],q,r=t[2]-t[1])); p=q) \\ Charles R Greathouse IV, Nov 12 2016
A275108
Record gaps between numbers that are either primes or semiprimes.
Original entry on oeis.org
1, 2, 3, 4, 6, 10, 11, 12, 16, 18, 19, 22, 24, 25, 26, 30, 32, 34, 36, 40, 42, 44, 51, 56, 64, 66, 70, 71, 78, 81, 85, 86, 91, 106, 110, 112, 128
Offset: 1
a(5) = 6 because the next prime or semiprime after 241 is 247, and that is a record gap of size 6.
-
checkrange(a, b, r)=while(b-a>r, forstep(n=a+r, a+1, -1, if(bigomega(n)<3, a=n; next(2))); for(n=a+r+1, b, if(bigomega(n)<3, return([a, n])))); 0
print1(1); p=5; r=1; forprime(q=7, 1e9, if(q-p<=r, p=q; next); t=checkrange(p, q, r); while(t, print1(", "t[2]-t[1]); t=checkrange(t[2], q, r=t[2]-t[1])); p=q) \\ Charles R Greathouse IV, Nov 19 2016
A278351
Least number that is the start of a prime-semiprime gap of size n.
Original entry on oeis.org
2, 7, 26, 97, 341, 241, 6091, 3173, 2869, 2521, 16022, 26603, 114358, 41779, 74491, 39343, 463161, 104659, 248407, 517421, 923722, 506509, 1930823, 584213, 2560177, 4036967, 4570411, 4552363, 7879253, 4417813, 27841051, 5167587, 13683034, 9725107, 47735342, 25045771, 63305661
Offset: 1
a(1) = 2 since there is a gap of 1 between 2 and 3, both of which are primes.
a(2) = 7 since there is a gap of 2 between 7 and 9, the first is a prime and the second is a semiprime.
a(3) = 26 since there is a gap of 3 between 26, a semiprime, and 29, a prime.
a(6) = 241 because the first prime-semiprime gap of size 6 is between 241 and 247.
-
nxtp[n_] := Block[{m = n + 1}, While[ PrimeOmega[m] > 2, m++]; m]; gp[_] = 0; p = 2; While[p < 1000000000, q = nxtp[p]; If[ gp[q - p] == 0, gp[q -p] = p; Print[{q -p, p}]]; p = q]; Array[gp, 40]
-
use ntheory ":all";
my($final,$p,$nextn,@gp) = (40,2,1); # first 40 values in order
forfactored {
if (scalar(@) <= 2) { my $q = $;
if (!defined $gp[$q-$p]) {
$gp[$q-$p] = $p;
while ($nextn <= $final && defined $gp[$nextn]) {
print "$nextn $gp[$nextn]\n";
$nextn++;
}
lastfor if $nextn > $final;
}
$p = $q;
}
} 3,10**14; # Dana Jacobsen, Sep 10 2018
A278404
Greater number in the least prime-semiprime gap of size n.
Original entry on oeis.org
3, 9, 29, 101, 346, 247, 6098, 3181, 2878, 2531, 16033, 26615, 114371, 41793, 74506, 39359, 463178, 104677, 248426, 517441, 923743, 506531, 1930846, 584237, 2560202, 4036993, 4570438, 4552391, 7879282, 4417843, 27841082, 5167619, 13683067, 9725141, 47735377, 25045807, 63305698
Offset: 1
a(1) = 3 since there is a gap of 1 between 2 and 3, both of which are primes.
a(2) = 9 since there is a gap of 2 between 7 and 9, the first is a prime and the second is a semiprime.
a(3) = 29 since there is a gap of 3 between 26, a semiprime, and 29, a prime.
a(6) = 247 because the first prime-semiprime gap of size 6 is between 241 and 247.
Showing 1-4 of 4 results.
Comments