The answer is in the affirmative. Letting ≡ denote congruence modulo pn throughout the argument, we will show that there exists a permutation a1,a2,…,aN of the numbers in U such that ∑k=1Nakak+1≡pn−1.
Let m=pn−1−1, so N=pn−1(p−1)=(m+1)(p−1), and write U={u1,u2,…,uN}, where uk=k+⌊k/(p−1)⌋, k=1,2,…,N, and ⌊t⌋ denotes the largest integer (strictly) less than the real number t.
That the uk are pairwise distinct and they all lie in U follows from the fact that every k in the range 1,2,…,N is uniquely expressible in the form k=(p−1)j+i for some j in the range 0,1,…,m and some i in the range 1,2,…,p−1. Thus, uk=u(p−1)j+i=pj+i, so the uk are indeed pairwise distinct and they all lie in U.
For k in the range 1,2,…,N−1, notice that uk+1−uk=1, unless k is divisible by p−1, in which case uk+1−uk=2. Setting uN+1=u1, it is readily checked that uN+1−uN=2−pn≡2, so uk+1−uk≡2 for all k divisible by p−1.
Letting now ak be the multiplicative inverse of uk modulo pn, i.e., ak is the unique member of U satisfying akuk≡1, we show that the ak form the desired permutation of U.
To begin with, notice that akak+1≡ak−ak+1, unless k is divisible by p−1, in which case akak+1≡21(ak−ak+1). This is easily established by multiplying both sides of each congruence by ukuk+1, and noticing that (ak−ak+1)ukuk+1≡uk+1−uk≡1 or 2.
We are now in a position to evaluate the sum S=∑k=1Nakak+1 modulo pn. Write
S=k=1∑Nakak+1=j=0∑mi=1∑p−1a(p−1)j+ia(p−1)j+i+1,
and consider the inner sum for a fixed j in the range 0,1,…,m:
i=1∑p−1a(p−1)j+ia(p−1)j+i+1=i=1∑p−2a(p−1)j+ia(p−1)j+i+1+a(p−1)j(j+1)a(p−1)(j+1)+1=i=1∑p−2(a(p−1)j+i−a(p−1)j+i+1)+21(a(p−1)j(j+1)−a(p−1)(j+1)+1)=a(p−1)j+1−a(p−1)(j+1)+21(a(p−1)j(j+1)−a(p−1)(j+1)+1)=a(p−1)j+1−21a(p−1)j(j+1)−21a(p−1)(j+1)+1.
Hence
S≡j=0∑ma(p−1)j+1−21j=0∑ma(p−1)(j+1)−21j=0∑ma(p−1)(j+1)+1≡(a1+j=1∑ma(p−1)j+1)−21j=1∑m+1a(p−1)j−21(j=1∑ma(p−1)j+1+aN+1)≡21j=1∑m+1a(p−1)j+1−21j=1∑m+1a(p−1)j.
Since u(p−1)j+1=pj+1, the a(p−1)j+1 form a permutation of the pj+1, therefore ∑j=1m+1a(p−1)j+1=∑j=1m+1(pj+1). Similarly, u(p−1)j=pj−1, so the a(p−1)j+1 form a permutation of the pj−1, and hence ∑j=1m+1a(p−1)j=∑j=1m+1(pj−1). Consequently,
S≡21j=1∑m+1((pj+1)−(pj−1))≡m+1≡pn−1,
as stated in the first paragraph. This completes the solution.