OFFSET
0,2
EXAMPLE
a(0) = 1 because 1 + 0 = 1 divides 0^(1 - 0)*(1 - 0)^0 + 1 = 1;
a(1) = 2 because 2 + 1 = 3 divides 2^(2 - 1)*(2 - 1)^2 + 1 = 3;
a(2) = 9 because 9 + 2 = 11 divides 9^(9 - 2)*(9 - 2)^9 + 1 = 4782969*40353607 + 1 = 193010051319184.
MATHEMATICA
a[5] = 19531249994; a[n_] := Block[{k = n + 1}, While[ Mod[ PowerMod[k, k-n, k+n] PowerMod[k-n, k, k+n] + 1, k+n] != 0, k++]; k]; a /@ Range[0, 40] (* Giovanni Resta, Oct 08 2019 *)
PROG
(PARI) a(n) = my(m=n+1); while ((m^(m - n)*(m - n)^m + 1) % (m+n), m++); m; \\ Michel Marcus, Oct 08 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Oct 07 2019
EXTENSIONS
a(5) and a(39)-a(47) from Giovanni Resta, Oct 08 2019
STATUS
approved