A381792 Numbers k such that k + prime(k) is prime and k + semiprime(k) is semiprime.
4, 6, 18, 24, 34, 72, 96, 98, 116, 130, 150, 172, 200, 206, 270, 290, 350, 356, 362, 386, 410, 420, 450, 504, 508, 554, 576, 618, 666, 682, 720, 738, 754, 782, 784, 808, 820, 832, 858, 892, 960, 962, 984, 1016, 1050, 1102, 1110, 1154, 1162, 1168, 1176, 1184, 1206, 1256, 1284, 1296, 1302, 1360
Offset: 1
Keywords
Examples
a(3) = 18 is a term because the 18-th prime and 18-th semiprime are 61 and 51 respectively, 18 + 61 = 79 is prime and 18 + 51 = 69 = 3 * 23 is semiprime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 100: # for a(1) .. a(N) with(priqueue): initialize(pq); insert([-4,2,2],pq); p:= 1: R:= NULL: count:= 0: for n from 1 while count < N do p:= nextprime(p); t:= extract(pq); if n::even and isprime(n + p) and numtheory:-bigomega(n - t[1])=2 then R:= R, n; count:= count+1 fi; q:= nextprime(t[3]); if t[2] = t[3] then insert([-q^2,q,q],pq) fi; insert([-t[2]*q,t[2],q],pq); od: R;
-
Mathematica
lim=1360;i=1;Do[Until[PrimeOmega[i]==2,i++];Sp[n]=i,{n,lim}];Select[Range[lim],PrimeQ[#+Prime[#]]&&PrimeOmega[#+Sp[#]]==2&] (* James C. McMahon, Mar 09 2025 *)
Comments