A154939 Primes p such that (p-1)*(p+1)-+p are primes.
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
Keywords
Examples
2*4=8-+3 -> primes, 4*6=24-+5 -> primes,...
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[p: p in PrimesUpTo(10000) | IsPrime(p^2+p-1) and IsPrime(p^2-p-1)]; // Vincenzo Librandi, Jul 10 2016
-
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 *)
Comments