OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
EXAMPLE
23 is the only prime between semiprimes 22 and 25.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Aug 06 2012
STATUS
approved