A225767 Least k>0 such that k^5+n is prime, or 0 if k^5+n is never prime.
0, 1, 1, 8, 1, 2, 1, 4, 3, 2, 1, 2, 1, 6, 3, 2, 1, 6, 1, 10, 3, 2, 1, 14, 7, 4, 3, 2, 1, 2, 1, 22, 0, 8, 3, 2, 1, 4, 3, 2, 1, 2, 1, 10, 5, 4, 1, 2, 13, 10, 3, 2, 1, 6, 17, 12, 5, 2, 1, 12, 1, 12, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 7, 2, 1, 4, 63, 2, 1, 18, 5, 4, 11, 32, 1, 14, 11, 6, 5, 4, 3, 2, 1, 6, 11, 2
Offset: 0
Keywords
Examples
a(3)=8 because 1^5+3, 2^5+3, ..., 7^5+3 are all composite, but 8^5+3=32771 is prime. a(32)=0 because x^5+32 = (x + 2)(x^4 - 2x^3 + 4x^2 - 8x + 16) is composite for all integer values of x>0.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- J. Brillhart, M. Filaseta, A. Odlyzko, On an irreducibility theorem of A. Cohn. Canad. J. Math. 33(1981), 1055-1059.
Programs
-
Maple
f:= proc(n) local x,k,F,nf,F1,C; if irreduc(x^5+n) then for k from 1+(n mod 2) by 2 do if isprime(k^5+n) then return k fi od else F:= factors(x^5+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^5+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^5 + n], SelectFirst[Range[1 + Mod[n, 2], 10^2, 2], PrimeQ[#^5 + n] &], 0], {n, 2, 120}] (* Michael De Vlieger, Apr 25 2016, Version 10 *)
-
PARI
A225767(a,b=5)={#factor(x^b+a)~==1&for(n=1,9e9,ispseudoprime(n^b+a)&return(n));a==1 || print1("/*"factor(x^b+a)"*/")} \\ For illustrative purpose only. The polynomial is factored to avoid an infinite search loop when it is composite. But a factored polynomial can yield a prime when all factors but one equal 1. This happens for b=4, n=4, cf. A225766.
Comments