OFFSET
1,2
EXAMPLE
The 4th nonprime is 8, and 8 divides 4^2 = 16, so 8 is in the sequence.
MAPLE
for n from 1 do
if n^2 mod A018252(n) = 0 then
print(n) ;
end if;
end do: # R. J. Mathar, Jun 04 2013
MATHEMATICA
seq = {}; np = n = 0; p = 2; While[n < 10^5, If[++np == p, p = NextPrime@p, n++; If[Mod[n^2, np] == 0, Print@{n, np, n^2/np}; AppendTo[seq, n]]]]; seq (* Giovanni Resta, May 27 2013 *)
Module[{nn=10^7, np, len}, np=Complement[Range[nn], Prime[ Range[ PrimePi[ nn]]]]; len=Length[np]; Transpose[Select[ Thread[ {Range[len], np}], Divisible[ First[#]^2, Last[#]]&]][[1]]] (* Harvey P. Dale, Sep 10 2014 *)
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Gerasimov Sergey, May 27 2013
EXTENSIONS
a(5)-a(38) from Giovanni Resta, May 27 2013
STATUS
approved