login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

Table of n, a(n) for n=1..35.

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

Cf. A000290, A007088, A070939.

Sequence in context: A014719 A139417 A329732 * A095873 A141801 A177083

Adjacent sequences:  A298813 A298814 A298815 * A298817 A298818 A298819

KEYWORD

nonn,base

AUTHOR

Alex Ratushnyak, Jan 26 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 6 09:45 EDT 2021. Contains 343580 sequences. (Running on oeis4.)