A270442 Smallest k > 1 such that none of k^2 - 0, k^2 - 1, k^2 - 2,..., k^2 - n are squarefree.
2, 3, 10, 941, 3052, 8173, 35359, 1526009, 30167284, 46952141, 574236841
Offset: 0
Examples
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.
Programs
-
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 *)
-
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
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