Skip to content
Get started

XOR of a thousand consecutive integers

Compute the bitwise XOR of every integer from 10001000 to 20252025 inclusive: 1000⊕1001⊕1002⊕⋯⊕2025.1000 \oplus 1001 \oplus 1002 \oplus \cdots \oplus 2025.

Show hints (2)+
  1. What is m⊕(m+1)m \oplus (m+1) when mm is even?
  2. A range XOR equals prefix-XOR to bb XOR prefix-XOR to a−1a-1.

Answer

Reveal answer →

1

Create a free account to see the full worked solution and track your progress.

Interview format: Trading Aptitude Tests, Prop Trading

Related questions