login
a(n) = least number k such that n*k^n+1 is prime, or 0 if no such number exists.
3

%I #15 Mar 31 2014 04:30:08

%S 1,1,4,1,8,1,4,3,10,1,42,1,60,15,22,1,8,1,198,42,10,1,8,115,34,21,0,1,

%T 54,1,130,3,4,7,72,1,778,204,30,1,108,1,178,15,14,1,924,28,234,63,

%U 1376,1,44,3,16,27,256,1,180,1,706,51,98,0,546,1,4,153,150,1,170

%N a(n) = least number k such that n*k^n+1 is prime, or 0 if no such number exists.

%C a(n) = 1 iff n+1 is prime.

%C If a(n) = 0, then n is in A097792. Note that the converse is not true: a(4) = 1, not 0.

%e 3*1^3+1 = 4 is not prime. 3*2^3+1 = 25 is not prime. 3*3^3+1 = 82 is not prime. 3*4^3+1 = 193 is prime. Thus, a(3) = 4.

%o (PARI) Pf(n) = for(k=1,10^4,if(ispseudoprime(n*k^n+1),return(k))); n=1; while(n<50,print(Pf(n));n+=1)

%Y Cf. A097792, A116954, A089001.

%K nonn

%O 1,3

%A _Derek Orr_, Mar 29 2014