Let $x_0 = 0$ and $x_n = n^2 \oplus x_{n - 1}$ for $n \ge 2$, where $a \oplus b$ denotes the bitwise exclusive OR operation (XOR).
QUESTION. Are there infinitely many perfect squares in the sequence $(x_n)$?
I present my ideas and research as following. The first 50 numbers are: 0, 1, 5, 12, 28, 5, 33, 16, 80, 1, 101, 28, 140, 37, 225, 0, 256, 33, 357, 12, 412, 37, 449, 976, 400, 993, 325, 924, 140, 965, 65, 896, 1920, 961, 1861, 908, 1692, 965, 1633, 912, 1488, 833, 1445, 668, 1292, 741, 2721, 512, 2816, 609. Because I don't see a simple pattern, I limited the search to perfect squares. Considering the 100,000 numbers we get:
(1, 1), (7, 16), (9, 1), (14, 225), (15, 0), (16, 256), (24, 400), (33, 961), (63, 256), (89, 2401), (193, 4225), (240, 50176), (255, 9216), (271, 9216), (430, 113569), (448, 20736), (528, 518400), (575, 160000), (729, 893025), (742, 390625), (783, 861184), (903, 685584), (1297, 134689), (1776, 861184), (2409, 3568321), (2623, 389376), (3494, 6806881), (4079, 12730624), (4159, 12730624), (5439, 4260096), (8278, 105534529), (13631, 1081600), (13737, 297025), (16128, 153363456), (41825, 159744321), (53007, 3226240000), (64344, 666259344), (95985, 228584161), (99015, 1296)
Note that $x_a = b$ for each pair $(a, b)$, so $a$ denotes the index. Increasing the search space yields a longer list, but it seems to grow sublinear.
If there are infinitely many zeros in the sequence, the claim follows. But in the first 1,000,000 numbers I found only one zero at index 15.
I assume there are infinitely many perfect squares in the sequence. Is that true? How to prove it?
BONUS QUESTION. Is there an $i \notin \{ 0, 15 \}$ with $x_i = 15$? If not, why?