Tessellate S.T.E.M.S. (2019) - Computer Science - School - Set 2 - Objective Problem 2

The XOR of all the numbers from 1 0 100 10^{100} to 1 0 1000 10^{1000} inclusive is


This problem is a part of Tessellate S.T.E.M.S (2019)

1 0 1000 10^{1000} 1 0 1000 10^{1000} - 1 0 100 10^{100} 0 1 0 100 10^{100}

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Brian Moehring
Oct 28, 2018

For brevity, I will write \oplus for the bitwise XOR.

Note that for any natural k , k, ( 4 k ) ( 4 k + 1 ) ( 4 k + 2 ) ( 4 k + 3 ) = 0 (4k) \oplus (4k+1) \oplus (4k+2) \oplus (4k+3) = 0 and that 1 0 100 10^{100} and 1 0 1000 10^{1000} are integral multiples of 4 , 4, so n = 1 0 100 1 0 1000 n = 1 0 1000 k = 1 0 100 4 1 0 1000 4 1 ( ( 4 k ) ( 4 k + 1 ) ( 4 k + 2 ) ( 4 k + 3 ) ) = 1 0 1000 k = 1 0 100 4 1 0 1000 4 1 0 = 1 0 1000 \begin{aligned} \bigoplus_{n=10^{100}}^{10^{1000}} n &= 10^{1000} \oplus \bigoplus_{k=\frac{10^{100}}{4}}^{\frac{10^{1000}}{4}-1} \left((4k) \oplus (4k+1) \oplus (4k+2) \oplus (4k+3)\right) \\ &= 10^{1000} \oplus \bigoplus_{k=\frac{10^{100}}{4}}^{\frac{10^{1000}}{4}-1} 0 \\ &= \boxed{10^{1000}} \end{aligned}

Great observation!

Tessellate STEMS Computer Science - 2 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...