cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A225767 Least k>0 such that k^5+n is prime, or 0 if k^5+n is never prime.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

See A225768 for motivation and references.
By the theorem of Brillhart, Filaseta and Odlyzko (see link), if a(n) > n > 1 then x^5 + n must be irreducible. If x^5 + n is irreducible, the Bunyakovsky conjecture implies a(n) is finite. - Robert Israel, Apr 25 2016

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.
		

Crossrefs

See A085099, A225765--A225770 for the k^2, k^3, ..., k^8 analogs.

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.