login
Lesser of two consecutive primes, p < q, such that p*q + p - q and p*q - p + q are also consecutive primes.
1

%I #19 Feb 25 2024 05:59:10

%S 2,3,23,991,1621,3301,5471,5683,6563,6581,7829,10061,13841,16981,

%T 18199,26203,28403,32003,35671,37561,41771,42571,55529,55603,58543,

%U 60251,71861,75931,92809,98993,103669,104281,116953,117751,125591,139969,142151,155509,160073

%N Lesser of two consecutive primes, p < q, such that p*q + p - q and p*q - p + q are also consecutive primes.

%H Charles R Greathouse IV, <a href="/A225726/b225726.txt">Table of n, a(n) for n = 1..10000</a> (first 100 terms from Lava)

%e 2 prime, 3 next-prime and 2*3 + 2 - 3 = 5 prime, 2*3 - 2 + 3 = 7 next-prime, so a(1) = 2.

%t acpQ[{p_,q_}]:=Module[{c=p*q+p-q},PrimeQ[c]&&NextPrime[c]==p*q-p+q]; Select[ Partition[Prime[Range[15000]],2,1],acpQ][[All,1]] (* _Harvey P. Dale_, Oct 09 2017 *)

%o (PARI) p=2; forprime(q=3,1e6,my(pq=p*q); if(isprime(pq+p-q) && nextprime(pq+p-q+1)==pq-p+q, print1(p", ")); p=q) \\ _Charles R Greathouse IV_, Mar 18 2014

%Y Cf. A154553.

%K nonn

%O 1,1

%A _Irina Gerasimova_, May 13 2013

%E Added a(5), a(6) and a(20)-a(39) by _Paolo P. Lava_, May 14 2013