https://en.wikipedia.org/wiki/Fermat's_theorem_on_sums_of_two_squares

`(2k)^2 mod 4 = 0`

, `(2k+1)^2 mod 4 = 1`

. So `a^2 + b^2 mod 4 in [0, 1, 2]`

, `n=4m+3`

return false.

...

```
func judgeSquareSum(c int) bool {
for i := 2; i*i <= c; i++ {
if c%i == 0 {
count := 0
for c%i == 0 {
count++
c /= i
}
if i%4 == 3 && count%2 != 0 {
return false
}
}
}
return c%4 != 3
}
```