Task
Write a program/function that when given a positive integer \$n\$ splits the numbers from \$1\$ to \$n\$ into two sets, so that no integers \$a, b, c\$, satisfying \$a^2 + b^2 = c^2\$ are all in the same set. For example, if \$3\$ and \$4\$ are in the first set, then \$5\$ must be in the second set since \$3^2+4^2=5^2\$.
Acceptable Output Formats:
- One of the sets
- Both the sets
- An array of length \$n\$ where the \$i\$-th element (counting from 1) is one of two different symbols (e.g. 0 and 1, a and b, etc.) which represent which set \$i\$ belongs to.The reverse of this is also fine
Constraints
You can expect \$n\$ to be less than \$7825\$. This is because \$7824\$ is proven to be the largest number to have solution (which also implies that all numbers less than 7825 have a solution).
Scoring
This is code-golf so shortest bytes wins.
Sample Testcases
3 -> {1}
3 -> {}
5 -> {1, 2, 3}
5 -> {1, 2, 3}, {4, 5}
5 -> [0, 0, 0, 1, 1]
5 -> [1, 1, 0, 0, 1]
10 -> {1, 3, 6}
10 -> {1, 2, 3, 4, 6, 9}
41 -> {5, 6, 9, 15, 16, 20, 24, 35}
A checker to verify your output can be found here
Inspired by The Problem with 7825 - Numberphile
n
below 7825? It may be worth clarifying in the challenge \$\endgroup\$start with an empty list A; for x = 1 to n: if there's some x in A such that sqrt(x²+n²) also exists in A: leave A unchanged else append x to A; return A
. \$\endgroup\$