OFFSET
0,1
EXAMPLE
a(0) = 2 because none of 2^2 - 0 = 4 = (2*2) is squarefree;
a(1) = 3 because none of 3^2 - 0 = 9 = (3*3), 3^2 - 1 = 8 = (2*2)*2 are squarefree;
a(2) = 10 because 10^2 - 0 = 100 = (2*2)*25, 10^2 - 1 = 99 = (3*3)*11, 10^2 - 2 = 98 = (7*7)*2 are squarefree.
MATHEMATICA
sk[n_]:=Module[{k=2}, While[AnyTrue[k^2-Range[0, n], SquareFreeQ], k++]; k]; Array[sk, 10] (* Requires Mathematica version 10 or later *) (* The program will take a long time to run. *) (* Harvey P. Dale, Jan 10 2021 *)
PROG
(PARI) isok(k, n) = {for (j=1, n, if (issquarefree(k^2-j), return (0)); ); 1; }
a(n) = {my(k = 2); while (! isok(k, n), k++); k; } \\ Michel Marcus, Apr 11 2016
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Juri-Stepan Gerasimov, Apr 09 2016
EXTENSIONS
Offset corrected by Michel Marcus, Apr 11 2016
a(8) from Michel Marcus, Apr 11 2016
a(9) from Seiichi Manyama, Sep 08 2018
a(10) from Giovanni Resta, Oct 29 2018
STATUS
approved