cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A214520 Primes that are the only prime between consecutive semiprimes.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Aug 06 2012

Keywords

Examples

			23 is the only prime between semiprimes 22 and 25.
		

Crossrefs

Cf. A001358 (semiprimes).
Cf. A088701 (n primes between semiprimes).

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