login
Larger of two consecutive prime numbers, p1 and p2 = p1 + d, such that p1*p2*d - d is the average of twin primes.
13

%I #14 Sep 08 2022 08:45:39

%S 1193,8923,13997,31847,33113,56039,57593,66593,85843,87803,90583,

%T 91229,93503,101323,103183,111697,113123,127453,141403,142897,150373,

%U 150413,151673,152623,156823,157133,161983,176849,179743,186013,205963,209431

%N Larger of two consecutive prime numbers, p1 and p2 = p1 + d, such that p1*p2*d - d is the average of twin primes.

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

%e 1193 since 1187 and 1193 = 1187 + 6 are consecutive primes, 1187*1193*6 - 6 = 8496540, and (8496539, 8496541) are twin primes.

%t lst={};Do[p1=Prime[n];p2=Prime[n+1];d=p2-p1;a=p1*p2*d-d;If[PrimeQ[a-1]&&PrimeQ[a+1],AppendTo[lst,p2]],{n,8!}];lst

%t l2cpQ[{a_,b_}]:=Module[{d=b-a},AllTrue[a*b*d-d+{1,-1},PrimeQ]]; Transpose[ Select[ Partition[Prime[Range[20000]],2,1],l2cpQ]][[2]] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Oct 18 2015 *)

%o (Magma) [q:p in PrimesUpTo(210000)| IsPrime(a-1) and IsPrime(a+1) where a is (p*q-1)*(q-p) where q is NextPrime(p)]; // _Marius A. Burtea_, Jan 03 2020

%Y Cf. A099349, A153374, A153375, A153376, A153377, A153378.

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Dec 24 2008

%E Name edited by _Amiram Eldar_, Jan 03 2020