A214520 Primes that are the only prime between consecutive semiprimes.
5, 7, 23, 37, 47, 53, 67, 79, 83, 89, 113, 127, 131, 157, 163, 167, 173, 211, 223, 251, 257, 263, 277, 293, 307, 317, 331, 337, 359, 367, 373, 379, 383, 389, 397, 401, 409, 449, 457, 467, 479, 487, 491, 499, 503, 509, 541, 547, 557, 563, 577, 587, 593, 613, 631
Offset: 1
Keywords
Examples
23 is the only prime between semiprimes 22 and 25.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; t = Select[Range[1000], SemiPrimeQ[#] &]; t2 = Select[Range[Length[t] - 1], PrimePi[t[[# + 1]]] - PrimePi[t[[#]]] == 1 &]; NextPrime[t[[t2]]] Transpose[Select[{NextPrime[#[[1]]],NextPrime[#[[2]],-1]}&/@ Partition[ Select[ Range[700],PrimeOmega[#]==2&],2,1],Length[Union[#]]==1&]][[1]] (* Harvey P. Dale, Sep 01 2015 *)
-
Perl
use ntheory ":all"; my($i,$l)=(0,4); forsemiprimes { my $n=next_prime($l); print ++$i," $n\n" if $n < $ && next_prime($n) > $; $l=$;} 6,257; # _Dana Jacobsen, Mar 04 2019