|
|
A298816
|
|
a(n) is the binary XOR of all n-bit squares, with a(2)=0 indicating that no 2-bit squares exist.
|
|
2
|
|
|
1, 0, 4, 9, 9, 21, 12, 28, 449, 577, 357, 997, 6085, 14533, 12517, 15077, 121125, 152869, 400028, 1041052, 1290704, 2556368, 4913664, 11950592, 22421376, 63692672, 7674753, 78355329, 312723717, 656197893, 1089399836, 2723474460, 4196236289, 2416016385, 8186515468
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
XOR is the binary exclusive-or operator.
|
|
LINKS
|
|
|
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 str(x)+', ',
x = 0
prevL = L
L = len(bin(nextn))-2
for j in range(prevL, L-1): print '0, ',
n = nextn
x ^= n
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|