OFFSET
1,2
FORMULA
a(n) = 2*n^2 - 3*n+2 for n=1, 2, 3, 5, 6, 8, 10, 13, 15, 18, 20, 23, 25, 26, 30, 31, 33, 35, 36, 40, 43, ...
MATHEMATICA
a[n_] := For[x = 1, True, x++, If[Mod[x^2+n^2, x+n-1] == 0, Return[x]]]; Array[a, 40] (* Jean-François Alcover, Feb 17 2018 *)
PROG
(PARI) a(n) = {my(k=1); while((k^2+n^2)%(k+n-1) != 0, k++); k; } \\ Altug Alkan, Feb 17 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jan 01 2002
EXTENSIONS
a(28) corrected by Altug Alkan, Feb 17 2018
STATUS
approved