Solution 1. We will show that there is a unique such n-tuple: ak=2n−1+2k−1−1 for k=1,…,n−1.
Write N=2n−1 and fk(x)=[N2kx+ak] for k=0,1,…,n−1, where a0=0. Since
k=0∑n−1fk(m)−k=0∑n−1fk(m−1)=1,
for each m∈Z, there is exactly one k for which fk(m)=fk(m−1)+1. We work modulo N. The last equality holds if and only if 2km+ak∈{0,1,…,2k−1}. I.e. if and only if
2km∈{−ak,1−ak,…,2k−1−ak}.
Multiplying with 2n−k, and noting that 2n≡1modN, we get the following:
For each m∈Z there is a unique k∈{0,1,…,n−1} such that m∈Bk (modulo N) where
Bk={bk,bk+2n−k,…,bk+(2k−1)2n−k}
with bk=−2n−kak. Therefore the problem condition is equivalent to ⋃k=0n−1Bk being a partition of {0,1,…,N−1}.
For a number b and set a A⊆Z we write b+A={b+a:a∈A}. With this notation, Bn−1=bn−1+{0,2,4,…,2n−2}. The set Bn−2=bn−2+{0,4,8,…,2n−4} is contained in Bn−1=bn−1+{1,3,…,2n−3}, implying bn−2,bn−2+2n−4∈Bn−1, which holds only if bn−2≡bn−1+1. Further, the set Bn−3=bn−3+{0,8,16,…,2n−8} is contained in Bn−1∪Bn−2=bn−1+{3,7,…,2n−5}, so we must have bn−3≡bn−1+3. Similarly, bn−4≡bn−1+7 etc. In general, bn−k≡bn−1+2k−1−1 for k=1,…,n−1. It follows that b0≡bn−1+2n−1−1. On the other hand, we have b0=0, which gives bn−1≡1−2n−1 and therefore bk≡2n−1−k−2n−1. Thus ak≡−2kbk≡2n+k−1−2n−1≡2n−1+2k−1−1 for k=1,…,n−1.
Finally, ∑kfk(0)=0 implies ak<N for all k, so we conclude that ak=2n−1+2k−1−1 for each k=1,2,…,n−1.
Solution 2. We will use the identity
[x]+⌊x+N1⌋+⌊x+N2⌋+⋯+⌊x+NN−1⌋=[Nx]
which holds for every x∈R and every N∈N. (One can check this by noting that the difference between the two sides of the identity is periodic with period 1/N and that the identity clearly holds for x∈[0,N1).)
Writing a0=0 and N=2n−1 we observe that
m=k=0∑n−1⌊N2km+ak⌋=r=0∑2k−1r=0∑2k−1⌊Nm+2kak+2kr⌋=k=0∑n−1r=0∑2k−1⌊Nm+2kak+rN⌋.(1)
It follows that cr,k=⌈2kak+rN⌉ are all distinct modulo N for k=0,1,…,n−1 and r=0,1,…,2k−1. Indeed if two (or more) of them are congruent to t, then writing f(t) for the right hand side of (1) we get 1=f(−t)−f(−t−1)≥2, a contradiction.
Since N=2n−1, then cr,k=r2n−k+dr,k, where dr,k=⌈2kak−r⌉. Because c0,0=0, then c0,k=0 for each k=0 giving ak≥2k for each k≥1. Setting m=0 in the original equation gives ak<N for each k and so d0,k≤2n−k−1 for each k. Furthermore
2n−k−1≥d0,k≥d1,k≥⋯≥d2k−1,k≥d2k,k=d0,k−1≥0.(2)
In particular 0≤cr,k=r2n−k+dr,k≤(2n−2n−k)+(2n−k−1)=N. For k=0,1,2,…,n−1 define Ak={cr,k:r=0,1,…,2k−1}. From the above, since A0={0}, we must have that A1∪A2∪⋯∪An−1={1,2,…,N−1}.
For a natural number t let v2(t) be as usual the largest exponent such that 2v2(t)∣t. Let
f(t)=n−v2(t)−1,g(t)=21+v2(t)t−2v2(t),andh(t)=2f(t)−1−g(t).
Note that f(t) uniquely determines v2(t) and together with g(t) they uniquely determine t. Similarly h(t) and g(t) uniquely determine t.
Claim. For each t∈{1,2,…,2n−1−1} we have:
(i) dg(t),f(t)=2v2(t),
(ii) dh(t),f(t)=2v2(t)−1,
(iii) cg(t),f(t)=t,
(iv) ch(t),f(t)=N−t.
Proof of Claim. We proceed by induction on t. For t=1 we have v2(1)=0,f(1)=n−1,g(1)=0 and h(1)=2n−1−1. From (2) we have 1≥d0,n−1 and d0,n−1−1≥0 proving (i). Also, cg(1),f(1)=c0,n−1=d0,n−1=1 proving (iii). From (2) we have 1≥d2n−1−1,n−1≥0. But c2n−1−1,n−1=2n−2+d2n−1−1,n−1=N−1+d2n−1−1,n−1. Since c2n−1−1,n−1≤N−1 we deduce both (ii) and (iv).
Assume now that the result is true for t=s−1. We will prove the result for t=s.
Case 1: If s−1=2u is even, then v2(s)=0, so f(s)=n−1,g(s)=u and h(s)=2n−1−1−u.
By the induction hypothesis, since all the cr,k's are distinct, we must have
s≤cg(s),f(s)=2u+dg(s),f(s)=s−1+dg(s),f(s)
and
N−s≥ch(s),f(s)=2n−2−2u+dh(s),f(s)=N−s+dh(s),f(s).
From the above we must have dg(s),f(s)≥1 and dh(s),f(s)≤0. But from (2) any two dr,k's for fixed k differ by at most 1. This can only be achieved if we have equalities everywhere proving (i)-(iv).
Case 2: If s−1=2u+1 is odd, then we write s=2u+2=2vw for some odd w. Then v2(s)=v and so k=f(s)=n−1−v and r=g(s)=(w−1)/2. Also h(s)=2k−1−r. By the induction hypothesis we must have
s≤cr,k=r2n−k+dr,k=2v(w−1)+dr,k=s−2v+dr,k
and
N−s≥ch(s),k=(2k−1−r)2n−k+dh(s),k=2n−2v+1−s+2v+dh(s),k=N+1−s−2v+dh(s),k.
From the above we must have dr,k≥2v and dh(s),k≤2v−1. As in Case 1 we must have equalities everywhere proving (i)-(iv). □
For t=2n−1−2n−k−1 we have v2(t)=n−k−1,f(t)=k,g(t)=2k−1−1 and h(t)=2k−1−(2k−1−1)=2k−1. Thus from (ii) and (iv) we get
[2kak−(2k−1−1)]=2n−k−1and[2kak−2k−1]=2n−k−1−1.
This is only possible if ak=2k⋅2n−k−1+(2k−1−1)=2n−1+2k−1−1 as required.