Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #23 Jan 20 2019 15:42:40
%S 1,4,5,4,7,2,3,10,33,42,19,12,17,52,59,18,65,2,51,2,23,120,35,2,63,10,
%T 39,186,7,74,47,200,53,24,19,48,333,56,57,192,127,348,63,124,213,60,
%U 359,2,213,2,387,526,269,252,863,16,131,370,503,294,83,68,317
%N a(n) = least k such that n^n - k is prime.
%H Seiichi Manyama, <a href="/A074967/b074967.txt">Table of n, a(n) for n = 2..500</a>
%t PrimePrevDelta[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k=n-k]; lst={};Do[AppendTo[lst,PrimePrevDelta[n^n]],{n,2,5!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Jun 11 2009 *)
%t lk[n_]:=Module[{nn=n^n},nn-NextPrime[nn,-1]]; Array[lk,70,2] (* _Harvey P. Dale_, Jan 20 2019 *)
%o (PARI) a(n)=(x->x-precprime(x))(n^n) \\ _Charles R Greathouse IV_, Nov 25 2014
%Y Cf. A033933, A074966.
%K nonn
%O 2,2
%A _Zak Seidov_, Oct 03 2002
%E More terms from _Robert G. Wilson v_, Oct 04 2002
%E Offset corrected by _R. J. Mathar_, Jun 12 2009