%I #3 Mar 30 2012 17:22:33
%S 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,
%T 186,1,32,1,26,261,4,0,8,1,62,3,22,1,6,1,8,945,76,1,116,129,382,93,
%U 330,1,2,555,224,1359,78,1,62,1,110,0,1032,37,462,1,100,9,88,1,1416,1,218
%N Least k such that the absolute value of k^n-n is prime or zero if no such k exists.
%C 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.
%t Table[If[MemberQ[{16, 27, 36, 64, 100}, n], 0, k=1; While[ !PrimeQ[k^n-n], k++ ]; k], {n, 100}]
%Y Cf. A097764 (n such that x^n-n is reducible), A072883 (least k such that k^n+n is prime).
%K nonn
%O 1,1
%A _T. D. Noe_, Aug 24 2004
|