Rating:

# Square Sum
![Square Sum](https://raw.githubusercontent.com/bsempir0x65/CTF_Writeups/main/KnightCTF_2022/img/KnightCTF_Square_Sum.png)

Here we had kind of the same issue but it was more or less clear what we were searching. So our magician swang his wand and we have this time R code:
```r
myfunction <- function(n) {
out <- NULL
for(a in 1:floor(sqrt(n))) {
b <- floor(sqrt(n - a^2))
if(a^2 + b^2 == n) {
out <- rbind(out, c(a, b))
}
}
return(out)
}
```
So the flag was *KCTF{90,130}*

Our [github](https://github.com/bsempir0x65/CTF_Writeups/tree/main/KnightCTF_2022#square-sum) and [webpage](https://bsempir0x65.github.io/CTF_Writeups/KnightCTF_2022/#square-sum)

Original writeup (https://github.com/bsempir0x65/CTF_Writeups/tree/main/KnightCTF_2022#square-sum).