Great, Cheuk Man Hwang! I realized after I gave that puzzle that it might be rather hard. I'll just sketch some of my own reasoning, without carrying out all the details.

As you note, the first step is to notice that to specify an action of a group on an \$$n\$$-element set is to break that set into disjoint sets called [orbits](https://en.wikipedia.org/wiki/Group_action#Orbits_and_stabilizers). For the group \$$\mathbb{Z}/p\$$ these orbits must be of size \$$1\$$ or \$$p\$$ - this is a simplification that occurs because \$$p\$$ is prime.

For each orbit of size \$$1\$$ there's nothing more to say: the group \$$\mathbb{Z}/p\$$ must act trivially. For each orbit of size \$$p\$$ we must choose a cyclic ordering of that orbit, to say how the group acts. There are \$$p!\$$ orderings of a set of size \$$p\$$, but only \$$(p-1)!\$$ cyclic orderings.

So, our answer will involve 3 ideas:

1) Let \$$k\$$ be the number of orbits of size \$$p\$$. This can range from \$$0\$$ up to \$$\lfloor n/p \rfloor\$$, so our answer will start with

$\sum_{k = 0}^{\lfloor n/p \rfloor} .$

2) Then we need to count the number of ways to chop our \$$n\$$-element set into \$$k\$$ subsets of size \$$p\$$ and \$$n - k p \$$ subsets of size \$$1\$$. The answer is the multinomial coefficient

${n \choose p, p, \ldots, p, 1, 1, \dots , 1}$

with \$$k\$$ \$$p\$$'s and \$$n-kp\$$ \$$1\$$'s. Remember, the [multinomial coefficient](https://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients) is made for exactly this task:

${n \choose k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\, k_2! \cdots k_m!}$

is the number of ways to chop an \$$n\$$-element set into disjoint parts of size \$$k_1, \dots, k_m\$$. In our particular example we get

${n \choose p, p, \ldots, p, 1, 1, \dots , 1} = \frac{n!}{(p!)^k}$

3) Then we need to include a factor of \$$(p-1)!\$$ for each orbit of size \$$p \$$.

Putting these ideas together, we get

$\sum_{k = 0}^{\lfloor n/p \rfloor} ((p-1)!)^k \frac{n!}{(p!)^k}$

We can simplify this a bit and get

$\sum_{k = 0}^{\lfloor n/p \rfloor} \frac{n!}{p^k}$

I hope this answer agrees with yours! It would take some calculations to check this. It's also quite possible I made a mistake; I think the basic strategy is right but it's easy to make mistakes, and I haven't checked my answer.