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.

This page as a plain text file.
%I A239474 #15 May 22 2025 10:21:37
%S A239474 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,
%T A239474 0,69,186,163,32,253,26,261,4,0,8,11,62,3,22,43,6,7,8,945,76,7,116,
%U A239474 129,382,93,330,361,2,555,224,1359,78,29,62,39,110,0,1032,37,462,29
%N A239474 Smallest k >= 1 such that k^n-n is prime. a(n) = 0 if no such k exists.
%C A239474 If n is of the form (pk)^p for some k and some prime p, then a(n) = 0 (See A097764).
%F A239474 a(A097764(n)) = 0 for all n.
%e A239474 1^1-1 = 0 is not prime. 2^1-1 = 1 is not prime. 3^1-1 = 2 is prime. Thus, a(1) = 3.
%o A239474 (Python)
%o A239474 import sympy
%o A239474 from sympy import isprime
%o A239474 def TwoMin(x):
%o A239474   for k in range(1,5000):
%o A239474     if isprime(k**x-x):
%o A239474       return k
%o A239474 x = 1
%o A239474 while x < 100:
%o A239474   print(TwoMin(x))
%o A239474   x += 1
%Y A239474 Cf. A072883, A028870, A153974, A239413, A239414, A239415, A239416, A239417, A239418.
%K A239474 nonn
%O A239474 1,1
%A A239474 _Derek Orr_, Mar 20 2014