%I #10 Nov 30 2019 16:46:13
%S 2,3,5,7,8,11,12,13,14,17,18,20,22,23,26,27,28,29
%N Nonsquares mod 30.
%e Since 5 is not a perfect square and there are no solutions to x^2 = 5 mod 30, 5 is in the sequence.
%e Although 6 is not a perfect square either, there are solutions to x^2 = 6 mod 30, such as x = 6, x = 24, so 6 is not in the sequence.
%t Complement[Range[30], PowerMod[Range[30], 2, 30]] (* _Alonso del Arte_, Nov 30 2019 *)
%o (Scala) val squaresMod30 = (1 to 30).map(n => n * n).map(_ % 30)
%o (0 to 29).diff(squaresMod30) // _Alonso del Arte_, Nov 30 2019
%Y Cf. A010462.
%K nonn,fini,full
%O 1,1
%A _N. J. A. Sloane_
%E Incorrect term 15 removed by _Alonso del Arte_, Nov 30 2019
|