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.

A097794 Least k such that the absolute value of k^n-n is prime or zero if no such k exists.

Original entry on oeis.org

3, 2, 1, 1, 4, 1, 60, 1, 2, 21, 28, 1, 2, 1, 28, 0, 234, 1, 2, 1, 2, 159, 10, 1, 68, 145, 0, 69, 186, 1, 32, 1, 26, 261, 4, 0, 8, 1, 62, 3, 22, 1, 6, 1, 8, 945, 76, 1, 116, 129, 382, 93, 330, 1, 2, 555, 224, 1359, 78, 1, 62, 1, 110, 0, 1032, 37, 462, 1, 100, 9, 88, 1, 1416, 1, 218
Offset: 1

Views

Author

T. D. Noe, Aug 24 2004

Keywords

Comments

Because the polynomial x^n - n is reducible for n in A097764, a(n) is 0 for n=16, 27, 36, 64, 100,.... Although x^4-4 is reducible, the factor x^2-2 is -1 for x=1.

Crossrefs

Cf. A097764 (n such that x^n-n is reducible), A072883 (least k such that k^n+n is prime).

Programs

  • Mathematica
    Table[If[MemberQ[{16, 27, 36, 64, 100}, n], 0, k=1; While[ !PrimeQ[k^n-n], k++ ]; k], {n, 100}]