%I #20 Aug 27 2024 09:15:17
%S 5,11,17,71,107,191,431,1151,2591,139967,472391,786431,995327,
%T 57395627,63700991,169869311,4076863487,10871635967,2348273369087,
%U 56358560858111,79164837199871,84537841287167,150289495621631,578415690713087,1141260857376767
%N Smaller term of a pair of twin primes such that prime factors of their average are only 2 and 3.
%C Primes p(k) such that the number of distinct prime divisors of all composite numbers between p(k) and p(k+1) is 2. - _Amarnath Murthy_, Sep 26 2002
%H Ray Chandler, <a href="/A059960/b059960.txt">Table of n, a(n) for n = 1..61</a> (terms < 10^1000, first 49 terms from T. D. Noe)
%F Primes p such that p+1 = (2^u)*(3^w).
%e a(11)+1 = 2*2*2*3*3*3*3*3*3*3*3*3*3 = 472392.
%t nn=10^15; Sort[Reap[Do[n=2^i 3^j; If[n<=nn && PrimeQ[n-1] && PrimeQ[n+1], Sow[n-1]], {i, Log[2, nn]}, {j, Log[3, nn]}]][[2, 1]]]
%t Select[Select[Partition[Prime[Range[38*10^5]],2,1],#[[2]]-#[[1]]==2&][[All,1]],FactorInteger[#+1][[All,1]]=={2,3}&] (* The program generates the first 15 terms of the sequence. *)
%t seq[max_] := Select[Sort[Flatten[Table[2^i*3^j - 1, {i, 1, Floor[Log2[max]]}, {j, 1, Floor[Log[3, max/2^i]]}]]], And @@ PrimeQ[# + {0, 2}] &]; seq[2*10^15] (* _Amiram Eldar_, Aug 27 2024 *)
%Y Cf. A014574, A002822, A033845, A058383, A027856.
%Y Cf. A052297, A075581, A075580, A075583, A075584, A075585, A075586, A075587, A075588, A075589.
%Y Apart from initial terms, same as A078883.
%K nonn
%O 1,1
%A _Labos Elemer_, Mar 02 2001