[go: up one dir, main page]

login
Search: a154551 -id:a154551
     Sort: relevance | references | number | modified | created      Format: long | short | data
Greater of two consecutive primes, p < q, such that both p*q+p-q and p*q-p+q are prime numbers.
+10
2
3, 5, 29, 509, 997, 1399, 1627, 3307, 4217, 5477, 5689, 6569, 6599, 7369, 7393, 7841, 8191, 8861, 10067, 11311, 11801, 13859, 14401, 15859, 16987, 17851, 18211, 20593, 21101, 24169, 25013, 25339, 25621, 26209, 28019, 28409, 28439, 32009, 35677
OFFSET
1,1
COMMENTS
3*5-2=13; 3*5+2=17, 23*29-6=661; 23*29+6=673...
LINKS
MAPLE
p:= 1: q:= 2: Res:= NULL:
while q < 100000 do
p:= q; q:= nextprime(q);
if isprime(p*q+p-q) and isprime(p*q+q-p) then
Res:= Res, q;
fi
od:
Res; # Robert Israel, May 10 2017
MATHEMATICA
lst={}; Do[pp=Prime[n-1]; p=Prime[n]; d=p-pp; If[PrimeQ[pp*p-d]&&PrimeQ[pp*p+d], AppendTo[lst, p]], {n, 2, 8!}]; lst
pqpQ[{p_, q_}]:=Module[{pq=p*q}, And@@PrimeQ[{pq+p-q, pq-p+q}]]; Transpose[ Select[Partition[Prime[Range[4000]], 2, 1], pqpQ]][[2]] (* Harvey P. Dale, May 20 2012 *)
PROG
(PARI) is(n)=my(p); isprime(n) && isprime((p=precprime(n-1))*n+p-n) && isprime(p*n-p+n) \\ Charles R Greathouse IV, May 10 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by Omar E. Pol, Jan 12 2009
STATUS
approved
Lesser of two consecutive primes, p < q, such that both p*q+p-q and p*q-p+q are prime numbers.
+10
2
2, 3, 23, 503, 991, 1381, 1621, 3301, 4211, 5471, 5683, 6563, 6581, 7351, 7369, 7829, 8179, 8849, 10061, 11299, 11789, 13841, 14389, 15823, 16981, 17839, 18199, 20563, 21089, 24151, 24989, 25321, 25609, 26203, 28001, 28403, 28433, 32003, 35671
OFFSET
1,1
COMMENTS
2*3-1=5;2*3+1=7, 3*5-2=13;3*5+2=17, ...
LINKS
MAPLE
with(numtheory); A154553:=proc(q) local a, b, n;
for n from 42676 to q do a:=ithprime(n); b:=nextprime(a);
if isprime(a*b+a-b) and isprime(a*b-a+b) then print(a);
fi; od; end: A154553(10^9); # Paolo P. Lava, May 14 2013
MATHEMATICA
lst={}; Do[p=Prime[n]; pn=Prime[n+1]; d=pn-p; If[PrimeQ[p*pn-d]&&PrimeQ[p*pn+d], AppendTo[lst, p]], {n, 8!}]; lst
pnQ[{p_, q_}]:=And@@PrimeQ[{p*q+p-q, p*q-p+q}]; Transpose[Select[ Partition[ Prime[Range[4000]], 2, 1], pnQ]][[1]] (* Harvey P. Dale, Jul 12 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by Omar E. Pol, Jan 12 2009
STATUS
approved

Search completed in 0.010 seconds