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.

A084745 Smallest prime of the form n^k - k, or 0 if no such prime exists.

Original entry on oeis.org

2, 2, 3, 23, 5, 47, 7, 79, 997, 5559917313492231463, 11, 167, 13, 223, 4093, 24137563, 17, 359, 19, 439, 10947877107572929152919737180202022857988400441953615831
Offset: 2

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 15 2003

Keywords

Comments

a(11) > 379749833583227. Conjecture: No entry is zero.
a(23) is 150 digits long and too long to include. - Alec Mihailovs (Alec(AT)Mihailovs.com), Jun 16 2003
If n-1 is a prime then a(n)=n-1. - Farideh Firoozbakht, Aug 09 2014

Examples

			a(7) = 47 = 7^2 - 2.
		

Crossrefs

Cf. A084746.

Programs

  • Maple
    a := proc(n) local k; k := 1; while not isprime(n^k-k) do k := k+1 od; n^k-k end: seq(a(n),n=2..35);
  • Mathematica
    sp[n_]:=Module[{k=1},While[!PrimeQ[n^k-k],k++];n^k-k]; Array[sp,21,2] (* Harvey P. Dale, Jul 22 2021 *)
  • PARI
    a(n)=my(k=1);while(!ispseudoprime(n^k-k),k++);return(n^k-k)
    vector(20, n, a(n+1)) \\ Derek Orr, Aug 08 2014

Formula

a(n) = n^A084746(n) - A084746(n). - Michel Marcus, Aug 09 2014

Extensions

More terms from Alec Mihailovs (Alec(AT)Mihailovs.com), Jun 16 2003