login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A028731 Nonsquares mod 18. 2

%I #19 Dec 20 2019 20:45:45

%S 2,3,5,6,8,11,12,14,15,17

%N Nonsquares mod 18.

%e Since 6 is not a perfect square and there is no solution in integers to x^2 = 6 mod 18, 6 is in the sequence.

%e Although 7 is not a perfect square either, we verify that x^2 = 7 mod 18 does have solutions, such as x = 5, x = 13. Therefore 7 is not in the sequence.

%t Complement[Range[17], PowerMod[Range[18], 2, 18]] (* _Alonso del Arte_, Nov 18 2019 *)

%o (Scala) val squaresMod18 = (0 to 17).map(n => n * n).map(_ % 18)

%o (0 to 17).diff(squaresMod18) // _Alonso del Arte_, Nov 18 2019

%o (PARI) is(n) = n<18 && !issquare(Mod(n, 18)) \\ _Felix Fröhlich_, Dec 18 2019

%Y Cf. A010380.

%Y Row 18 of A096013.

%K nonn,fini,full

%O 1,1

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 15 01:58 EDT 2024. Contains 375929 sequences. (Running on oeis4.)