TITLE: The pattern of bitstrings of square numbers
QUESTION [7 upvotes]: Here is a picture of "square numbers" from mathworld website.


A plot of the first few square numbers represented as a sequence of binary bits is shown above. The top portion shows $1^2$ to $255^2$, and the bottom shows the next 510 values. (Black is for "one" bit, and while is for "zero" bit)

I want to learn more about this pattern. However, there is no further explanation about the pattern of this plot from the website. 
Is there any known result about this pattern ?

REPLY [3 votes]: Note that each line is periodic.  The bottom line alternates white and black, as even and odd numbers have even and odd squares.  The next line is the leading bit of the numbers $\pmod 4$.  As the squares $\pmod 4$ go $0,1,0,1$ it will always be white.  The squares $\pmod {16}$ go $0,1,4,9,0,1,4,9,0,1,4,9,0,1,4,9$  so the next line up will go white, white, black, white and repeat.  The next will be white, white, white, black.  You can continue .