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.

Showing 1-10 of 12 results. Next

A200926 Records in A085099.

Original entry on oeis.org

1, 2, 6, 7, 9, 12, 24, 27, 45, 69, 93, 114, 129, 132, 159, 210, 225, 270, 294, 357, 402, 414, 420, 432, 474, 585, 630, 651, 744, 855, 1008, 1011, 1170
Offset: 1

Views

Author

Zak Seidov, Nov 24 2011

Keywords

Comments

Positions of records are in A200948.

Examples

			n=5: 5+(1..5)^2=(6,9,13,21,30) all composite and 5+6^2=41 is prime hence a(5)=6.
		

Crossrefs

A053000 a(n) = (smallest prime > n^2) - n^2.

Original entry on oeis.org

2, 1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 6, 5, 4, 1, 2, 1, 4, 7, 6, 1, 2, 3, 12, 1, 6, 1, 4, 3, 12, 7, 6, 7, 2, 7, 4, 1, 4, 3, 2, 1, 12, 13, 12, 13, 2, 13, 4, 5, 10, 3, 8, 3, 10, 1, 12, 1, 2, 7, 10, 7, 6, 3, 20, 3, 4, 1, 4, 13, 22, 3, 10, 5, 4, 1, 14, 3, 10, 5, 6, 21, 2, 9, 10, 1, 4, 15, 4, 9, 6, 1, 6, 3, 14
Offset: 0

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Record values are listed in A070317, their indices in A070316. - M. F. Hasler, Mar 23 2013
Conjecture: a(n) <= 1+phi(n) = 1+A000010(n), for n>0. This improves on Oppermann's conjecture, which says a(n) < n. - Jianglin Luo, Sep 22 2023

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A1.

Crossrefs

Programs

  • Magma
    [NextPrime(n^2) - n^2: n in [0..100]]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    A053000 := n->nextprime(n^2)-n^2;
  • Mathematica
    nxt[n_]:=Module[{n2=n^2},NextPrime[n2]-n2]
    nxt/@Range[0,100]  (* Harvey P. Dale, Dec 20 2010 *)
  • PARI
    A053000(n)=nextprime(n^2)-n^2  \\ M. F. Hasler, Mar 23 2013
    
  • Python
    from sympy import nextprime
    def a(n): nn = n*n; return nextprime(nn) - nn
    print([a(n) for n in range(94)]) # Michael S. Branicky, Feb 17 2022

Formula

a(n) = A013632(n^2). - Robert Israel, Jul 06 2015

Extensions

More terms from James Sellers, Feb 22 2000

A225765 Least k>0 such that k^3+n is prime, or 0 if there is no such k.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 4, 0, 2, 1, 2, 1, 6, 3, 2, 1, 6, 1, 4, 3, 2, 1, 2, 5, 4, 3, 0, 1, 2, 1, 10, 3, 2, 3, 2, 1, 4, 5, 2, 1, 6, 1, 4, 3, 2, 1, 6, 5, 4, 11, 2, 1, 2, 5, 6, 3, 8, 1, 2, 1, 6, 3, 2, 0, 2, 1, 4, 5, 10, 1, 2, 1, 4, 3, 2, 3, 6, 1, 24, 3, 2, 1, 12, 13, 4
Offset: 1

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

See A225768 for motivation.
a(n) = 0 for n = m^3 (m > 1) but are there other cases of a(n)=0? - Zak Seidov, Nov 10 2014

Examples

			a(7)=4 because 1^3+7=8, 2^3+7=15, 3^3+7=34 are all composite, but 4^3+7=71 is prime.
a(8)=0 because x^3+8 = (x+2)(x^2-2x+4) is composite for all integer values x>0.
		

Crossrefs

See A085099, A225766, A225767, A225768 for the k^2, k^4, k^5, k^6 analog.

Programs

  • PARI
    A225765(a,b=3)={#factor(x^b+a)~==1&for(n=1,9e9,ispseudoprime(n^b+a)&return(n));a==1&return(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 this does not exclude that all but one factors might equal 1, therefore the factorization is printed for control before 0 is returned.
    
  • PARI
    a(n) = {if ((n!=1) && ispower(n, 3), return (0)); k = 1; while (! isprime(k^3+n), k++); k;} \\ Michel Marcus, Nov 10 2014

Extensions

More terms from Michel Marcus, Nov 10 2014

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

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

Motivated by the "particularly poor polynomial" n^6+1091 (composite for n=1,...,3905) mentioned on Weisstein's page about prime generating polynomials.
We have a(n) = 0 if n is a cube n = g^3 with g > 1 because then k^6 + g^3 = (k^2 + g)*(k^4 - k^2*g + g^2), which can be prime only when n = g = 1. - T. D. Noe, Nov 18 2013
By the theorem of Brillhart, Filaseta and Odlyzko (see link), if a(n) > n > 1 then x^6 + n must be irreducible. If x^6 + n is irreducible, the Bunyakovsky conjecture implies a(n) is finite. - Robert Israel, Apr 25 2016

Crossrefs

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

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. */

A058055 a(n) is the smallest positive number m such that m^2 + n is the next prime > m^2.

Original entry on oeis.org

1, 3, 8, 5, 12, 11, 18, 51, 82, 49, 234, 23, 42, 75, 86, 231, 174, 107, 288, 63, 80, 69, 102, 325, 166, 765, 128, 143, 822, 727, 276, 597, 226, 835, 702, 461, 254, 693, 592, 797, 1284, 349, 370, 2337, 596, 645, 3012, 1033, 590, 4083, 1490, 757, 882, 833, 1668
Offset: 1

Views

Author

Labos Elemer, Nov 20 2000

Keywords

Comments

The primes are in A058056.

Examples

			n=6: a(6)=11 and 11^2+6 is 127, a prime; n=97: a(97) = 2144 and 2144^2+97 = 4596833, the least prime of the form m^2+97.
		

Crossrefs

See A085099, A215249 for other versions.

Programs

  • Maple
    for m from 1 to 10^5 do
       r:= nextprime(m^2)-m^2;
       if not assigned(R[r]) then R[r]:= m end if;
    end do:
    J:= map(op,{indices(R)}):
    N:= min({$1..J[-1]} minus J)-1:
    [seq(R[j],j=1..N)]; # Robert Israel, Aug 10 2012
  • Mathematica
    nn = 100; t = Table[0, {nn}]; found = 0; m = 0; While[found < nn, m++; k = NextPrime[m^2] - m^2; If[k <= nn && t[[k]] == 0, t[[k]] = m; found++]]; t (* T. D. Noe, Aug 10 2012 *)
  • Sage
    R = {}   # After Robert Israel's Maple script.
    for m in (1..2^12) :
        r = next_prime(m^2) - m^2
        if r not in R : R[r] = m
    L = sorted(R.keys())
    for i in (1..len(L)-1) :
        if L[i] != L[i-1]+1 : break
    [R[k] for k in (1..i)]  # Peter Luschny, Aug 11 2012

Formula

a(n) = Min{ m > 0 | m^2 + n is the next prime after m^2}.
A053000(a(n)) = n. - Zak Seidov, Apr 12 2013

Extensions

Definition corrected by Zak Seidov, Mar 03 2008, and again by Franklin T. Adams-Watters, Aug 10 2012

A225770 Least k > 0 such that k^8 + n is prime, or 0 if there is no such k.

Original entry on oeis.org

0, 1, 1, 4, 1, 12, 1, 2, 3, 110, 1, 6, 1, 2, 195, 2, 1, 6, 1, 40, 3, 2, 1, 66, 25, 2, 9, 2, 1, 180, 1, 22, 15, 58, 25, 408, 1, 2, 3, 10, 1, 12, 1, 4, 465, 4, 1, 12, 5, 10, 147, 2, 1, 6, 35, 2, 45, 2, 1, 570, 1, 2, 21, 4, 0, 6, 1, 6, 9, 100, 1
Offset: 0

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

See A225768 for motivation and references.

Examples

			a(0) = 0 since k^8 is not prime for any k > 0.
a(4) = 1 since k^8 + 4 is prime for k = 1, although k^8 + 4 = (k^4 - 2k^2 + 2)(k^4 + 2k^2 + 2), but the first factor equals 1 for k = 1.
a(64) = 0 since k^8 + 64 = (k^4 - 4*k^2 + 8)(k^4 + 4k^2 + 8) which is composite for all integers k > 1.
		

Crossrefs

See A085099, A225765, ..., A225769 for the k^2, k^3, ..., k^7 analogs.

Programs

  • PARI
    A225770(a,b=8)={#factor(x^b+a)~==1&for(n=1,9e9,ispseudoprime(n^b+a)&return(n));a==0 || a==64 || 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 n=4, cf. example.

A225766 Least k>0 such that k^4+n is prime, or 0 if k^4+n is always composite.

Original entry on oeis.org

0, 1, 1, 2, 1, 6, 1, 2, 3, 10, 1, 6, 1, 2, 165, 2, 1, 12, 1, 20, 3, 2, 1, 6, 35, 2, 3, 2, 1, 90, 1, 2, 3, 8, 5, 12, 1, 2, 9, 10, 1, 60, 1, 2, 75, 2, 1, 18, 5, 20, 3, 2, 1, 12, 85, 2, 3, 2, 1, 30, 1, 4, 21, 2, 0, 6, 1, 2, 3, 10, 1, 6, 1, 2, 255, 4, 3, 6, 1, 10, 27, 2, 1, 72, 5, 2, 3, 2, 1, 570, 11, 2, 3, 2, 5, 18, 1, 2, 3, 10
Offset: 0

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

See A225768 for motivation and references.

Examples

			a(4)=1 because 1^4+4=5 is prime. (Although x^4+4 = (x^2-2*x+2)(x^2+2x+2), this is prime for x=1 when the first factor equals 1.)
a(5)=6 because 1^4+5=6, 2^4+5=21, 3^4+5=86, 4^4+5=261 and 5^4+5 are all composite, but 6^4+5=1301 is prime.
a(64)=0 because x^4+64 = (x^2-4*x+8)(x^2+4x+8) is composite for all integer values of x>0. Indeed, x^2-4x+8=(x-2)^2+4 > 1 for all x.
		

Crossrefs

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

Programs

  • PARI
    {(a,b=4)->#factor(x^b+a)~==1&for(n=1,9e9,ispseudoprime(n^b+a)&return(n));a==1 || a==4 || 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 but one factors equal 1. This happens for n=4, cf. Example.

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.

A215249 a(n) is the smallest number m >= n such that m^2 + n is a prime.

Original entry on oeis.org

1, 3, 4, 5, 6, 11, 8, 9, 10, 11, 24, 13, 16, 15, 16, 21, 24, 19, 20, 21, 40, 25, 24, 35, 26, 69, 28, 33, 30, 31, 34, 39, 56, 35, 48, 49, 38, 39, 50, 41, 54, 47, 44, 45, 46, 49, 48, 53, 50, 57, 56, 53, 54, 55, 56, 69, 64, 59, 60, 67, 64, 105, 64, 65, 66, 71, 68, 75
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2012

Keywords

Crossrefs

Programs

  • Mathematica
    Table[m = n; While[! PrimeQ[m^2 + n], m++]; m, {n, 100}] (* T. D. Noe, Aug 12 2012 *)

A225769 Least k>0 such that k^7+n is prime, or 0 if there is no such k.

Original entry on oeis.org

0, 1, 1, 2, 1, 6, 1, 16, 9, 2, 1, 2, 1, 6, 5, 22, 1, 8, 1, 10, 3, 2, 1, 2, 17, 12, 3, 4, 1, 2, 1, 6, 5, 4, 3, 2, 1, 4, 5, 2, 1, 6, 1, 4, 23, 2, 1, 24, 5, 4, 3, 2, 1, 2, 5, 6, 3, 28, 1, 8, 1, 22, 39, 2, 3, 2, 1, 4, 5, 2, 1, 2, 1, 6, 9, 34, 7, 6, 1, 10, 3, 16, 1, 2, 23, 22, 3, 14, 1, 14, 23, 12, 9, 4, 3, 2, 1, 4, 9, 2, 1, 2, 1, 4, 5, 2, 1, 8, 1, 4, 3, 2, 1, 2, 23, 12, 5, 40, 31, 92, 7
Offset: 0

Views

Author

M. F. Hasler, Jul 25 2013

Keywords

Comments

See A225768 for motivation and references.

Crossrefs

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

Programs

  • PARI
    (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.
Showing 1-10 of 12 results. Next