%I #23 Jun 27 2023 14:20:20
%S 4,16,36,144,196,256,400,484,900,1156,1296,1600,1764,2704,2916,3136,
%T 3364,3600,4356,5184,6084,7056,7396,7744,8100,8464,8836,9216,10404,
%U 10816,11236,11664,12100,12544,12996,16384,16900,19044,19600,20164,20736,22500
%N Squares with squarefree neighbors.
%C All terms are multiples of 4. Whether n is congruent to 1 or 3 mod 4, n^2 is congruent to 1 mod 3 and therefore mu(n^2 - 1) = 0. - _Alonso del Arte_, Dec 12 2013
%H Charles R Greathouse IV, <a href="/A233409/b233409.txt">Table of n, a(n) for n = 1..10000</a>
%e 36 is in this sequence because 35 and 37 are both squarefree.
%e 64 is not in this sequence because 63 = 3^2 * 7.
%t Select[Table[n^2, {n, 150}], SquareFreeQ[# - 1] && SquareFreeQ[# + 1] &] (* _Vaclav Kotesovec_, Dec 11 2013 *)
%t Select[Range[150]^2, Abs[MoebiusMu[# - 1] MoebiusMu[# + 1]] == 1 &] (* _Alonso del Arte_, Dec 11 2013 *)
%t SequencePosition[Table[Which[IntegerQ[Sqrt[n]],1,SquareFreeQ[n],2,True,0],{n,25000}],{2,1,2}][[;;,1]]+1 (* _Harvey P. Dale_, Jun 27 2023 *)
%o (PARI) forstep(n=2,1e3,[2, 2, 6, 2, 2, 2, 2],if(issquarefree(n-1) && issquarefree(n+1) && issquarefree(n^2+1), print1(n^2", "))) \\ _Charles R Greathouse IV_, Mar 18 2014
%Y Cf. A000290, A005117, A088068.
%K nonn
%O 1,1
%A _Irina Gerasimova_, Dec 09 2013