login
A081945
Numbers k such that both k*(k + 1) + 1 and k*(k - 1) + 1 are primes.
2
2, 3, 6, 15, 21, 78, 90, 111, 162, 168, 189, 246, 279, 288, 405, 435, 456, 531, 567, 762, 819, 960, 993, 1002, 1092, 1098, 1149, 1182, 1275, 1365, 1422, 1443, 1449, 1548, 1560, 1659, 1701, 1848, 1932, 1974, 2016, 2163, 2205, 2373, 2430, 2451, 2484, 2541
OFFSET
1,1
COMMENTS
Numbers k such that k^4 + k^2 + 1 is a semiprime (A001358). - Thomas Ordowski, Sep 24 2015
EXAMPLE
6 is a term since both 6*7 + 1 = 43 and 6*5 + 1 = 31 are primes.
MATHEMATICA
Select[Range[3000], PrimeQ[# (# - 1) + 1] && PrimeQ[# (# + 1) + 1] &] (* T. D. Noe, Apr 06 2012 *)
Select[Range[2, 3000], Plus@@Last/@FactorInteger[(#^6 - 1) / (#^2 - 1)] == 2 &] (* Vincenzo Librandi, Sep 24 2015 *)
Select[Range[2600], PrimeOmega[#^4+#^2+1]==2&] (* Harvey P. Dale, Jun 04 2019 *)
PROG
(Magma) [n: n in [0..3000] | IsPrime(n^2+n+1) and IsPrime(n^2-n+1)]; // Vincenzo Librandi, Sep 24 2015
(PARI) for(n=1, 1e3, if (isprime(n*(n+1)+1) && if (isprime(n*(n-1)+1), print1(n", ")))) \\ Altug Alkan, Sep 24 2015
CROSSREFS
Cf. A081944.
Sequence in context: A198684 A293534 A066653 * A329745 A255353 A248652
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Apr 02 2003
EXTENSIONS
More terms from Don Reble, Apr 08 2003
STATUS
approved