|
|
A028731
|
|
Nonsquares mod 18.
|
|
2
|
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
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.
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.
|
|
MATHEMATICA
|
Complement[Range[17], PowerMod[Range[18], 2, 18]] (* Alonso del Arte, Nov 18 2019 *)
|
|
PROG
|
(Scala) val squaresMod18 = (0 to 17).map(n => n * n).map(_ % 18)
(PARI) is(n) = n<18 && !issquare(Mod(n, 18)) \\ Felix Fröhlich, Dec 18 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,fini,full
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|