A225768 Least k > 0 such that k^6 + n is prime, or 0 if k^6 + n is never prime.
0, 1, 1, 2, 1, 18, 1, 2, 0, 2, 1, 54, 1, 28, 3, 2, 1, 18, 1, 2, 399, 26, 1, 6, 5, 2, 21, 0, 1, 288, 1, 4, 3, 2, 105, 6, 1, 2, 33, 2, 1, 546, 1, 2, 3, 2, 1, 6, 35, 2, 51, 20, 1, 12, 5, 28, 9, 4, 1, 18, 1, 4, 63, 2, 0, 18, 1, 2, 3, 28, 1, 6, 1, 2, 15, 2, 35, 24, 1, 12, 3, 4, 1, 42, 115, 2, 111, 2, 1, 18, 91, 6, 3, 2, 3, 6, 1, 28, 3, 2
Offset: 0
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- J. Brillhart, M. Filaseta, and A. Odlyzko, On an irreducibility theorem of A. Cohn, Canadian Journal of Mathematics 33(1981), 1055-1059.
- Eric Weisstein's World of Mathematics, Prime-Generating Polynomial.
Programs
-
Maple
f:= proc(n) local exact, x,k,F,nf,F1,C; iroot(n,3,exact); if exact and n > 1 then return 0 fi; if irreduc(x^6+n) then for k from 1+(n mod 2) by 2 do if isprime(k^6+n) then return k fi od else F:= factors(x^6+n)[2]; # F1:= map(t -> t[1],F); nf:= nops(F); C:= map(t -> op(map(rhs@op,{isolve(t^2-1)})),F1); for k in sort(convert(select(type,C,positive),list)) do if isprime(k^6+n) then return k fi od: 0 fi end proc: map(f, [$0..100]); # Robert Israel, Apr 25 2016
-
Mathematica
{0, 1}~Join~Table[If[IrreduciblePolynomialQ[x^6 + n], SelectFirst[Range[1 + Mod[n, 2], 10^3, 2], PrimeQ[#^6 + n] &], 0], {n, 2, 120}] (* Michael De Vlieger, Apr 25 2016, Version 10 *)
-
PARI
{(a,b=6)->#factor(x^b+a)~==1 & for(n=1, 9e9, ispseudoprime(n^b+a)&return(n)); a==1&return(1);print1("/*"a":", factor(x^b+a)"*/")} /* For illustrative purpose only. The polynomial x^6+a is factored to avoid an infinite loop when it is composite. But there could be x such that this is prime, when all factors but one are 1 (not for exponent b=6, but, e.g., x=4 for exponent b=4), see A225766. */
Comments