login
A154939
Primes p such that (p-1)*(p+1)-+p are primes.
9
3, 5, 11, 31, 101, 131, 149, 181, 241, 331, 419, 449, 709, 1051, 1061, 1171, 1409, 1549, 1579, 1699, 1759, 1831, 2069, 3229, 3449, 3761, 3911, 4159, 4951, 5821, 6029, 6481, 6661, 6679, 6899, 7079, 7151, 7229, 7369, 8101, 8219, 8629, 8861, 9091, 9161, 9521
OFFSET
1,1
COMMENTS
That is, primes p such that p^2+p-1 and p^2-p-1 are both primes: intersection of A053184 and A091567. - Michel Marcus, Jul 10 2016
LINKS
EXAMPLE
2*4=8-+3 -> primes, 4*6=24-+5 -> primes,...
MATHEMATICA
lst={}; Do[p=Prime[n]; If[PrimeQ[(p-1)*(p+1)-p]&&PrimeQ[(p-1)*(p+1)+p], AppendTo[lst, p]], {n, 7!}]; lst
Select[Prime[Range[1500]], And@@PrimeQ/@{#^2 - # - 1, #^2 + # - 1} &] (* Vincenzo Librandi, Jul 10 2016 *)
Select[Prime[Range[1500]], AllTrue[(#-1)(#+1)+{#, -#}, PrimeQ]&] (* Harvey P. Dale, Sep 21 2023 *)
PROG
(Magma) [p: p in PrimesUpTo(10000) | IsPrime(p^2+p-1) and IsPrime(p^2-p-1)]; // Vincenzo Librandi, Jul 10 2016
KEYWORD
nonn
AUTHOR
STATUS
approved