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-4 of 4 results.

A087576 Smallest number k > 1 such that k^n+2 is prime.

Original entry on oeis.org

3, 3, 3, 3, 9, 39, 9, 3, 11, 3, 15, 9, 9, 3, 3, 15, 5, 9, 63, 15, 27, 39, 41, 3, 51, 3, 59, 75, 119, 99, 71, 141, 209, 87, 65, 3, 275, 45, 23, 21, 27, 27, 69, 477, 59, 147, 231, 1605, 9, 291, 65, 15, 75, 57, 9, 225, 119, 273, 855, 33, 77, 513, 3, 219, 75, 51, 489, 369
Offset: 1

Views

Author

Amarnath Murthy, Sep 17 2003

Keywords

Comments

Some of the results were computed using the PrimeFormGW (PFGW) primality-testing program. - Hugo Pfoertner, Nov 16 2019

Crossrefs

Cf. A095302 (corresponding primes), A095303 (smallest k such that k^n-2 is prime), A095304 (corresponding primes).

Programs

  • Mathematica
    Table[k = 2; While[p = k^n + 2; ! PrimeQ[p], k++]; k, {n, 68}] (* T. D. Noe, Apr 03 2012 *)
  • PARI
    for(n=1,68,forstep(k=3,oo,2,if(isprime(k^n+2),print1(k,", ");break))) \\ Hugo Pfoertner, Oct 30 2018

Extensions

Corrected and extended by Hugo Pfoertner, computed using PFGW, Jun 01 2004
a(49) corrected by T. D. Noe, Apr 03 2012

A095304 Smallest prime of the form k^n-2.

Original entry on oeis.org

2, 2, 727, 79, 241, 727, 823541, 5764799, 19681, 16679880978199, 31381059607, 13841287199, 42052983462257057, 6103515623, 4747561509941, 28644003124274380508351359, 98526125335693359373, 136753052840548005895349735207879, 22168378200531005859373
Offset: 1

Views

Author

Hugo Pfoertner, Jun 01 2004

Keywords

Examples

			a(7)=7^7-2=823541 is prime whereas 3^7-2=2185 and 5^7-2=78123 are composite.
		

Crossrefs

Cf. A095303 (smallest k such that k^n-2 is prime), A087576 (smallest k such that k^n+2 is prime), A095302 (corresponding primes).

Programs

  • Mathematica
    Table[k = 2; While[p = k^n - 2; ! PrimeQ[p], k++]; p, {n, 20}] (* T. D. Noe, Apr 03 2012 *)

Extensions

a(2) corrected by Zak Seidov, Apr 03 2012

A095302 Smallest prime of the form k^n+2 with k>1.

Original entry on oeis.org

3, 5, 11, 29, 83, 59051, 3518743763, 4782971, 6563, 2357947693, 59051, 8649755859377, 282429536483, 2541865828331, 4782971, 14348909, 6568408355712890627, 762939453127, 150094635296999123, 15398217140735709790332844752065729, 332525673007965087890627
Offset: 0

Views

Author

Hugo Pfoertner, Jun 01 2004

Keywords

Examples

			a(5) = 59051 because 9^5+2 is prime whereas 3^5+2 = 5*7^2, 5^5+2 = 53*59 and 7^5+2 = 3*13*431 are composite.
		

Crossrefs

Cf. A087576 (corresponding k).
Cf. A095303 and A095304 (for k^n-2).

Programs

  • Mathematica
    sp[n_]:=Module[{k=2},While[!PrimeQ[k^n+2],k++];k^n+2]; Array[sp,30,0] (* Harvey P. Dale, Feb 22 2012 *)

Extensions

More terms from Harvey P. Dale, Feb 22 2012

A245516 The smallest odd number k such that k^n-2 is a prime number.

Original entry on oeis.org

5, 3, 9, 3, 3, 3, 7, 7, 3, 21, 9, 7, 19, 5, 7, 39, 15, 61, 15, 19, 21, 3, 19, 17, 21, 5, 21, 7, 85, 17, 7, 21, 511, 27, 27, 59, 3, 19, 91, 45, 3, 29, 321, 65, 9, 379, 69, 125, 49, 5, 9, 45, 289, 341, 61, 89, 171, 171, 139, 21, 139, 75, 25, 49, 15, 51, 57, 175
Offset: 1

Views

Author

Lei Zhou, Jul 24 2014

Keywords

Examples

			n=1, 3-2=1 is not prime, 5-2=3 is a prime number.  So a(1) = 5.
n=2, 3^2-2=7 is a prime number.  So a(2) = 3.
n=10, for k=3, 5, ..., 19, k^10-2 are all composite.  21^10-2 = 16679880978199 is a prime number.  So a(10) = 21.
		

Crossrefs

Cf. A095303.

Programs

  • Maple
    A245516 := proc(n)
        for k from 1 by 2 do
            if isprime(k^n-2) then
                return k;
            end if;
        end do:
    end proc:
    seq(A245516(n),n=1..60) ;
  • Mathematica
    Table[n = 1;
    While[n = n + 2; cp = n^i - 2; ! PrimeQ[cp]]; n, {i, 1, 68}]
Showing 1-4 of 4 results.