To determine all natural numbers n for which there exists a permutation (a1,a2,…,an) of the numbers 0,1,…,n−1 such that, if bi is the remainder of a1+a2+⋯+ai upon division by n for i=1,…,n, then (b1,b2,…,bn) is also a permutation of 0,1,…,n−1, we proceed as follows:
1. **Expression for bi:**
bi≡a1+a2+⋯+ai(modn)
We need (b1,b2,…,bn) to be a permutation of 0,1,…,n−1.
2. **Sum of bi:**
i=1∑nbi≡i=1∑n(a1+a2+⋯+ai)(modn)
This can be rewritten as:
i=1∑nbi≡n⋅a1+(n−1)⋅a2+⋯+2⋅an−1+an(modn)
3. **Considering n=3:**
For n=3, we need to check if there exists a permutation (a1,a2,a3) of 0,1,2 such that (b1,b2,b3) is a permutation of 0,1,2.
4. General Case Analysis:
- If n is even, then n must be a prime number. If n is composite, then at least two of the bi's will be equal, which contradicts the requirement that (b1,b2,…,bn) is a permutation of 0,1,…,n−1.
5. Constructing the Permutation:
- For n to be a prime number, we can construct the permutation (a1,a2,…,an) such that (b1,b2,…,bn) is a permutation of 0,1,…,n−1.
6. **Example for n=5:**
- Consider n=5. We can take (a1,a2,a3,a4,a5)=(0,4,1,3,2).
- Then, bi will be:
b1=0,b2=4,b3=0+4+1=5≡0(mod5),b4=0+4+1+3=8≡3(mod5),b5=0+4+1+3+2=10≡0(mod5)
- This does not work, so we need to find another permutation.
7. Conclusion:
- The only natural numbers n for which there exists such a permutation are prime numbers.
The final answer is n must be a prime number.