OFFSET
1,3
COMMENTS
XOR is the binary exclusive-or operator.
EXAMPLE
There are two squares whose binary representation is 5 bits long, namely 16 and 25. a(5) = 9 because 25 XOR 16 = 9.
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.
PROG
(Python)
i = n = x = L = 1
while L < 47:
i+=1
nextn = i*i
if (nextn ^ n) > n: # if lengths of binary representations are different
print(x, end=', ')
x = 0
prevL = L
L = len(bin(nextn))-2
for j in range(prevL, L-1): print(0, end=', ')
n = nextn
x ^= n
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Alex Ratushnyak, Jan 26 2018
STATUS
approved