Let d=νp(a), so a=pd⋅b with p∤b. We call a function f:Z/aZ→Z/peZ essential if Δkf=f for some k≥1.
Claim (Characterization of essential functions):
A function f is essential if and only if
f(x)+f(x+pd)+⋯+f(x+(b−1)pd)=0(1)
for all x.
Proof that essential implies the equation:
Suppose f is essential, with ΔNf=f. Then f is in the image of Δk for any k, because ΔmNf=f for any m. The following lemma will be useful.
Lemma:
Let g:Z/aZ→Z/peZ be any function, and let h=Δpdg. Then
h(x)+h(x+pd)+⋯+h(x+(b−1)pd)≡0(modp)
for all x.
Proof of Lemma. By definition,
h(x)=Δpdg(x)=k=0∑pd(−1)k(kpd)g(x+pd−k).
However, it is known that (kpd) is a multiple of p if 1≤k≤pd−1, so
h(x)≡g(x+pd)+(−1)pdg(x)(modp).
Using this, we easily obtain
h(x)+h(x+pd)+⋯+h(x+(b−1)pd)≡{02(g(x)+g(x+pd)+⋯+g(x+(b−1)pd))p>2p=2≡0(modp),
so the lemma is proved.
Corollary:
Let g:Z/aZ→Z/peZ be any function, and let h=Δepdg. Then
h(x)+h(x+pd)+⋯+h(x+(b−1)pd)=0
for all x.
This immediately settles this direction, since f is in the image of Δepd.
Proof the equation implies essential:
Let S be the set of all functions satisfying (1); then it's easy to see that Δ is a function on S. To show that all functions in S are essential, it's equivalent to show that Δ is a permutation on S.
We will show that Δ is injective on S. Suppose otherwise, and consider two functions f, g in S with Δf=Δg. Then, we obtain that f and g differ by a constant; say g=f+λ. However, then
g(0)+g(pd)+⋯+g((b−1)pd)=(f(0)+λ)+(f(pd)+λ)+⋯+(f((b−1)pd)+λ)=(f(0)+f(pd)+⋯+f((b−1)pd))+bλ.
This should also be zero. Since p∤b, we obtain λ=0, as desired.
Counting:
Finally, we can count the essential functions: all but the last pd entries can be chosen arbitrarily, and then each remaining entry has exactly one possible choice. This leads to a count of
pa−pd
for the number of essential functions when e=1.
---
Second solution (by Daniel Zhu):
There are two parts to the proof: solving the e=1 case, and using the e=1 result to solve the general problem by induction on e. These parts are independent of each other.
**The case e=1:**
Represent functions f as elements
αf:=k∈Z/aZ∑f(−k)xk∈Fp[x]/(xa−1)
Then, since αΔf=(x−1)αf, we wish to find the number of α∈Fp[x]/(xa−1) such that (x−1)mα=α for some m.
Now, make the substitution y=x−1 and let P(y)=(y+1)a−1; we want to find α∈Fp[y]/(P(y)) such that ymα=α for some m.
If we write P(y)=ydQ(y) with Q(0)=0, then by the Chinese Remainder Theorem we have the ring isomorphism
Fp[y]/(P(y))≅Fp[y]/(yd)×Fp[y]/(Q(y)).
Note that y is nilpotent in the first factor, while it is a unit in the second factor. So the α that work are exactly those that are zero in the first factor; thus there are pa−d such α. We can calculate d=pvp(a) (via, say, Lucas's Theorem), so we are done.
The general problem:
The general idea is as follows: call a f:Z/aZ→Z/peZ e-good if Δmf=f for some m. Our result above allows us to count the 1-good functions. Then, if e≥1, every (e+1)-good function, when reduced mod pe, yields an e-good function, so we count (e+1)-good functions by counting how many reduce to any given e-good function.
Formally, we use induction on e, with the e=1 case being treated above. Suppose now we have solved the problem for a given e≥1, and we now wish to solve it for e+1. For any function g:Z/aZ→Z/pe+1Z, let gˉ:Z/aZ→Z/peZ be its reduction mod pe. For a given e-good f, let n(f) be the number of (e+1)-good g with gˉ=f. The following two claims now finish the problem:
Claim 1: If f is e-good, then n(f)>0.
Proof. Suppose m is such that Δmf=f. Pick any g with gˉ=f, and consider the sequence of functions
g,Δmg,Δ2mg,…
Since there are finitely many functions Z/aZ→Z/pe+1Z, there must exist a<b such that Δamg=Δbmg. We claim Δamg is the desired (e+1)-good function. To see this, first note that since Δkg=Δkgˉ, we must have Δamg=Δamf=f. Moreover,
Δ(b−a)m(Δamg)=Δbmg=Δamg,
so Δamg is (e+1)-good. □
Claim 2: If f is e-good, and n(f)>0, then n(f) is exactly the number of 1-good functions, i.e. pa−pvp(a).
Proof. Let g be any (e+1)-good function with gˉ=f. We claim that the (e+1)-good g1 with gˉ1=f are exactly the functions of the form g+peh for any 1-good h. Since these functions are clearly distinct, this characterization will prove the claim.
To show that this condition is sufficient, note that g+peh=gˉ=f. Moreover, if Δmg=g and Δm′h=h, then
Δmm′(g+peh)=Δmm′g+peΔmm′h=g+peh.
To show that this condition is necessary, let g1 be any (e+1)-good function such that gˉ1=f. Then g1−g is also (e+1)-good, since if Δmg=g, Δm′g1=g1, we have
Δmm′(g1−g)=Δmm′g1−Δmm′g=g1−g.
On the other hand, we also know that g1−g is divisible by pe. This means that it must be peh for some function h:Z/aZ→Z/pZ, and it is not hard to show that g1−g being (e+1)-good means that h is 1-good. □
Final answer:
The number of functions f:Z/aZ→Z/peZ such that Δkf=f for some k≥1 is
pe(a−pvp(a))