login
A057683
Numbers k such that k^2 + k + 1, k^3 + k + 1 and k^4 + k + 1 are all prime.
2
1, 2, 5, 6, 12, 69, 77, 131, 162, 426, 701, 792, 1221, 1494, 1644, 1665, 2129, 2429, 2696, 3459, 3557, 3771, 4350, 4367, 5250, 5670, 6627, 7059, 7514, 7929, 8064, 9177, 9689, 10307, 10431, 11424, 13296, 13299, 13545, 14154, 14286, 14306, 15137
OFFSET
1,2
COMMENTS
After a(0) = 1, k^5 + k + 1 is never prime. Proof: k^5 + k + 1 = (k^2 + k + 1)*(k^3 - k^2 + 1). - Jonathan Vos Post, Oct 17 2007, edited by Robert Israel, Aug 01 2016
For n > 1, no terms == 1 (mod 3) or == 3 (mod 5). - Robert Israel, Jul 31 2016
LINKS
Reinhard Zumkeller and Robert Israel, Table of n, a(n) for n = 1..10000 (n = 1..100 from Reinhard Zumkeller).
EXAMPLE
5 is included because 5^2 + 5 + 1 = 31, 5^3 + 5 + 1 = 131 and 5^4 + 5 + 1 = 631 are all prime.
MAPLE
select(n -> isprime(n^4+n+1) and isprime(n^3+n+1) and isprime(n^2+n+1), [$1..50000]); # Robert Israel, Jul 31 2016
MATHEMATICA
Select[Range[16000], And@@PrimeQ/@(Table[n^i+n+1, {i, 2, 4}]/.n->#)&] (* Harvey P. Dale, Mar 28 2011 *)
PROG
(Magma) [n: n in [0..20000]|IsPrime(n^2+n+1) and IsPrime(n^3+n+1) and IsPrime(n^4+n+1)] // Vincenzo Librandi, Dec 20 2010
(Haskell)
a057683 n = a057683_list !! (n-1)
a057683_list = filter (all (== 1) . p) [1..] where
p x = map (a010051 . (+ (x + 1)) . (x ^)) [2..4]
-- Reinhard Zumkeller, Nov 12 2012
(Python)
from sympy import isprime
A057683_list = [n for n in range(10**5) if isprime(n**2+n+1) and isprime(n**3+n+1) and isprime(n**4+n+1)] # Chai Wah Wu, Apr 02 2021
CROSSREFS
Cf. A049407.
Cf. Subsequence of A219117; A010051.
Sequence in context: A257805 A082552 A243798 * A277012 A277022 A232603
KEYWORD
easy,nice,nonn
AUTHOR
Harvey P. Dale, Oct 20 2000
STATUS
approved