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.

A217612 Difference between n-th prime and the smallest semiprime greater than it.

This page as a plain text file.
%I A217612 #14 Sep 15 2022 12:20:40
%S A217612 2,1,1,2,3,1,4,2,2,4,2,1,5,3,2,2,3,1,2,3,1,3,2,2,9,5,3,4,2,2,2,2,4,2,
%T A217612 6,4,1,3,2,4,4,2,3,1,4,2,2,3,8,6,2,8,6,2,2,2,5,3,1,6,4,2,2,3,1,2,3,2,
%U A217612 8,6,2,2,4,4,2,3,2,1,2,2,3,1,6,4,6,2,2
%N A217612 Difference between n-th prime and the smallest semiprime greater than it.
%C A217612 Similar to A121885, but with smallest semiprime greater than it.
%H A217612 Antonio Roldán, <a href="/A217612/b217612.txt">Table of n, a(n) for n = 1..1229</a>
%F A217612 a(n) = A102414(n) - A000040(n).
%e A217612 a(7) = 4, because 17 is the seventh prime and 17+1 = 18 = 2*3^2, 17+2 = 19 = 19 and 17+3 = 20 = 2^2*5 are not semiprimes, but 17+4 = 21 = 3*7 is a semiprime.
%t A217612 SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] + 1; While[! SemiPrimeQ[i], i++]; i - Prime[n], {n, 87}] (* _T. D. Noe_, Oct 08 2012 *)
%t A217612 ssp[p_]:=Module[{k=1},While[PrimeOmega[p+k]!=2,k++];k]; Table[ssp[p],{p,Prime[ Range[100]]}] (* _Harvey P. Dale_, Sep 15 2022 *)
%o A217612 (PARI) m=0;forprime(n=2,10000,k=0;while(bigomega(n+k)<>2, k=k+1);m=m+1;write("B217612.txt",m,"  ",k)) \\ _Antonio Roldán_, Oct 08 2012
%K A217612 nonn
%O A217612 1,1
%A A217612 _Antonio Roldán_, Oct 08 2012