login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers that are the product of two distinct primes a and b, such that a+b are averages of twin prime pairs.
7

%I #9 Jan 02 2020 04:15:51

%S 35,65,77,161,185,209,221,335,341,371,377,437,485,515,611,671,707,731,

%T 767,779,851,899,917,965,1007,1067,1115,1157,1211,1247,1271,1337,1385,

%U 1397,1529,1535,1577,1631,1691,1781,1817,1841,1991,2117,2171,2201,2285

%N Numbers that are the product of two distinct primes a and b, such that a+b are averages of twin prime pairs.

%H Amiram Eldar, <a href="/A176875/b176875.txt">Table of n, a(n) for n = 1..10000</a>

%e 35 = 5*7 is a term since 5 + 7 +- 1 are twin primes.

%t l[n_]:=Last/@FactorInteger[n]; f[n_]:=First/@FactorInteger[n]; lst={};Do[If[l[n]=={1,1},a=f[n][[1]];b=f[n][[2]];If[PrimeQ[a+b-1]&&PrimeQ[a+b+1],AppendTo[lst,n]]],{n,0,7!}];lst

%t With[{nn=100},Take[Union[Times@@@Select[Subsets[Prime[Range[nn]],{2}], AllTrue[Total[#]+{1,-1},PrimeQ]&]],nn/2]] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, May 09 2015 *)

%Y Cf. A006881, A014574.

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Apr 27 2010