A291318 Semiprimes of the form p*q such that p+q-1 is prime.
4, 9, 15, 33, 35, 49, 51, 65, 77, 87, 91, 95, 119, 123, 143, 161, 177, 185, 209, 213, 215, 217, 221, 247, 259, 287, 303, 321, 329, 335, 341, 361, 371, 377, 395, 403, 407, 411, 427, 437, 447, 469, 473, 485, 511, 515, 527, 533, 537, 545, 551, 573, 581, 591, 611, 629
Offset: 1
Examples
4 = 2*2 and 2+2-1 is prime, so 4 is a term. 185 = 5*37 and 5+37-1 is prime, so 185 is a term.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 1000: # to get terms <= N OddPrimes:= select(isprime, [seq(i,i=3..N/3,2)]): R:= select(t -> t[1]*t[2]<= N and isprime(t[1]+t[2]-1), [[2,2],seq(seq([OddPrimes[i],OddPrimes[j]],j=1..i),i=1..nops(OddPrimes))]): sort(map(t -> t[1]*t[2],R)); # Robert Israel, Aug 22 2017
-
Mathematica
With[{nn=60}, Take[#, nn]&@Union@Flatten@Table[Function[p, Map[Times@@#&@#&, #]&@Select[Map[{p, #}&, Prime@Range[PrimePi@p]], PrimeQ[Total@# - 1] &]]@Prime@n,{n, nn + 4}]] (* Second program: *) Select[Range@ 630, And[Length@ # == 2, PrimeQ[First@ # + Last@ # - 1]] &@ Flatten@Map[ConstantArray[#1, #2] & @@ # &, FactorInteger[#]] &] (* Michael De Vlieger, Aug 22 2017 *)
-
PARI
list(lim)=my(v=List([4])); forprime(p=3,lim\3, forprime(q=3,min(lim\p,p), if(isprime(p+q-1), listput(v,p*q)))); Set(v) \\ Charles R Greathouse IV, Aug 23 2017
Comments