This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A298816 #12 Mar 01 2025 22:49:41 %S A298816 1,0,4,9,9,21,12,28,449,577,357,997,6085,14533,12517,15077,121125, %T A298816 152869,400028,1041052,1290704,2556368,4913664,11950592,22421376, %U A298816 63692672,7674753,78355329,312723717,656197893,1089399836,2723474460,4196236289,2416016385,8186515468 %N A298816 a(n) is the binary XOR of all n-bit squares, with a(2)=0 indicating that no 2-bit squares exist. %C A298816 XOR is the binary exclusive-or operator. %e A298816 There are two squares whose binary representation is 5 bits long, namely 16 and 25. a(5) = 9 because 25 XOR 16 = 9. %e A298816 There are four squares whose binary representation is 7 bits long, namely 64, 81, 100 and 121. a(7) = (64 XOR 81 XOR 100 XOR 121) = 12. %o A298816 (Python) %o A298816 i = n = x = L = 1 %o A298816 while L < 47: %o A298816 i+=1 %o A298816 nextn = i*i %o A298816 if (nextn ^ n) > n: # if lengths of binary representations are different %o A298816 print(x, end=', ') %o A298816 x = 0 %o A298816 prevL = L %o A298816 L = len(bin(nextn))-2 %o A298816 for j in range(prevL, L-1): print(0, end=', ') %o A298816 n = nextn %o A298816 x ^= n %Y A298816 Cf. A000290, A007088, A070939. %K A298816 nonn,base %O A298816 1,3 %A A298816 _Alex Ratushnyak_, Jan 26 2018