A049407 Numbers m such that m^3 + m + 1 is prime.
1, 2, 3, 5, 6, 8, 9, 12, 15, 17, 18, 21, 29, 30, 32, 39, 41, 42, 44, 48, 53, 54, 56, 60, 69, 71, 74, 77, 83, 87, 95, 102, 104, 108, 116, 117, 120, 126, 131, 135, 143, 144, 146, 152, 153, 155, 162, 168, 177, 179, 180, 186, 191, 207, 212, 219, 221, 225, 239, 240, 243
Offset: 1
Examples
3 is a term because 1 + 3 + 3^3 = 31 is a prime.
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[n: n in [0..300] | IsPrime(s) where s is 1+&+[n^i: i in [1..3 by 2]]]; // Vincenzo Librandi, Jun 27 2014
-
Maple
A049407:=n->`if`(isprime(n^3+n+1), n, NULL): seq(A049407(n), n=1..300); # Wesley Ivan Hurt, Nov 14 2014
-
Mathematica
Select[Range[500], PrimeQ[Total[#^Range[1, 3, 2]] + 1] &] (* Vincenzo Librandi, Jun 27 2014 *)
-
PARI
is(n)=isprime(n^3+n+1) \\ Charles R Greathouse IV, Nov 20 2012
-
Python
from sympy import isprime def ok(m): return isprime(m**3 + m + 1) print([m for m in range(244) if ok(m)]) # Michael S. Branicky, Feb 17 2022
Comments