Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #10 Mar 04 2019 17:19:56
%S 5,7,23,37,47,53,67,79,83,89,113,127,131,157,163,167,173,211,223,251,
%T 257,263,277,293,307,317,331,337,359,367,373,379,383,389,397,401,409,
%U 449,457,467,479,487,491,499,503,509,541,547,557,563,577,587,593,613,631
%N Primes that are the only prime between consecutive semiprimes.
%H T. D. Noe, <a href="/A214520/b214520.txt">Table of n, a(n) for n = 1..10000</a>
%e 23 is the only prime between semiprimes 22 and 25.
%t 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]]]
%t 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 *)
%o (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
%Y Cf. A001358 (semiprimes).
%Y Cf. A088701 (n primes between semiprimes).
%K nonn
%O 1,1
%A _T. D. Noe_, Aug 06 2012