%I #22 Nov 29 2019 19:15:35
%S 9,15,25,39,65,111,169,183,185,219,305,365,471,481,579,785,793,831,
%T 939,949,965,1191,1263,1369,1371,1385,1565,1623,1839,1983,1985,2019,
%U 2041,2105,2199,2257,2271,2285,2509,2631,2701,2705,2991
%N Semiprimes p*q such that p+1 and q+1 are semiprimes.
%C Numbers of the form A005383(i)*A005383(j) for i,j >= 1. - _Altug Alkan_, Mar 22 2018
%H Robert Israel, <a href="/A193227/b193227.txt">Table of n, a(n) for n = 1..10000</a>
%e 1371 is in the sequence because 1371 = 3 * 457, and 3 + 1 = 4 and 457 + 1 = 2 * 229 are semiprimes.
%p with(numtheory):for n from 2 to 3000 do: x:=factorset(n):y:=bigomega(n):z:=x[1]:zz:=n/z:if y=2 and type(z,prime)=true and type(zz,prime) = true and bigomega(z+1)=2 and bigomega(zz+1)=2 then printf(`%d, `, n): else fi:od:
%p # Alternate:
%p N:= 10000: # to get all terms <= N
%p P:= select(p -> isprime(p) and numtheory:-bigomega(p+1)=2, [$1..N/3]):
%p nP:= nops(P):
%p sort(select(`<=`, [seq(seq(P[i]*P[j],i=1..j),j=1..nP)],N)); # _Robert Israel_, Mar 22 2018
%t Take[Sort[Times@@@Select[Flatten[Table[{Prime[p], Prime[q]}, {p, 2, 200}, {q, p}], 1], PrimeOmega[#[[1]] + 1] == 2 && PrimeOmega[#[[2]] + 1] == 2 &]], 45] (* _Alonso del Arte_, Jul 18 2011 *)
%t cQ[n_]:=Module[{fi=FactorInteger[n]},Which[PrimeOmega[n]==2&&IntegerQ[Sqrt[ n]],PrimeOmega[ Sqrt[n]+1]==2,PrimeOmega[n] == 2,PrimeOmega[ 1+ fi[[All,1]]] =={2,2},True,False]]; Select[Range[3000],cQ]
%o (PARI) list(lim)=my(v=List(),u=List(),t);forprime(p=3,lim\3,if(isprime((p+1)/2),listput(v,p)));for(i=1,#v,for(j=i,#v,t=v[i]*v[j];if(t>lim,break);listput(u,t)));vecsort(Vec(u)) \\ _Charles R Greathouse IV_, Jul 18 2011
%Y Subsequence of A001358.
%Y Cf. A005383, A193165.
%K nonn
%O 1,1
%A _Michel Lagneau_, Jul 18 2011
|