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.

A239474 Smallest k >= 1 such that k^n-n is prime. a(n) = 0 if no such k exists.

Original entry on oeis.org

3, 2, 2, 0, 4, 5, 60, 3, 2, 21, 28, 5, 2, 199, 28, 0, 234, 11, 2, 3, 2, 159, 10, 31, 68, 145, 0, 69, 186, 163, 32, 253, 26, 261, 4, 0, 8, 11, 62, 3, 22, 43, 6, 7, 8, 945, 76, 7, 116, 129, 382, 93, 330, 361, 2, 555, 224, 1359, 78, 29, 62, 39, 110, 0, 1032, 37, 462, 29
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

If n is of the form (pk)^p for some k and some prime p, then a(n) = 0 (See A097764).

Examples

			1^1-1 = 0 is not prime. 2^1-1 = 1 is not prime. 3^1-1 = 2 is prime. Thus, a(1) = 3.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def TwoMin(x):
      for k in range(1,5000):
        if isprime(k**x-x):
          return k
    x = 1
    while x < 100:
      print(TwoMin(x))
      x += 1

Formula

a(A097764(n)) = 0 for all n.