%I #28 Apr 20 2016 05:08:56
%S 2,5,18,17,1600,984,2888,460747,99271723,792174,32917926
%N For n>=0, let A_n be the set of natural numbers k such that (k^n + 1) | k!. If A is nonempty, then a(n) is the least element of A_n; otherwise a(n) = 0.
%C a(n) is the smallest k such that (k^n + 1) | k! if it exists, otherwise a(n) = 0.
%e For n=2, a(2) is equal to 18 because k=18 is the least natural number k such that (k^2+1)|k! (see A120416).
%t For[k = 0, k < 11, k++, x = 0; r = 0; n = 1; While[x != 1, If[Mod[n!, n^k + 1] != 0, x = 0, x = 1; r = n]; n++]; Print[r]]
%t Table[SelectFirst[Range[10^4], Divisible[#!, #^n + 1] &], {n, 0, 6}] (* _Michael De Vlieger_, Mar 04 2016, Version 10 *)
%o (PARI) a(n) = {my(k = 1); while (k! % (k^n+1), k++); k;} \\ _Michel Marcus_, Mar 03 2016
%Y Cf. A118742, A120416, A270441.
%K nonn,more
%O 0,1
%A _José Hernández_, Mar 02 2016
%E a(7)-a(9) from _Hiroaki Yamanouchi_, Apr 04 2016
%E a(10) from _Giovanni Resta_, Apr 20 2016
|