I imagine that the following question has a well known (and perhaps, easily obtainable) answer, but I can't find it by myself nor along the references that I have in mind so far.
So, if $f$ is a nonnegative measurable function defined on some measure space $(\Omega,\mathcal{F},\mu)$ and $\lambda_{f}:[0,+\infty)\to\mathbb [0,+\infty]$ is the distribution function of $f$, namely $$\lambda_{f}(t)=\mu(f^{-1}(t,+\infty))$$ then for all $p>0$ $$\int f^{p} d\mu=p\int_{(0,+\infty)} t^{p-1}\lambda_{f}(t)dt$$ where $dt$ is Lebesgue measure and both integrals are infinite if $f\notin L^{p}_{\mu}$ (see for instance Folland's Real Analysis: Modern Techniques and their Applications, section 6.4).
This is the question: is the statement $f\in L^{p}_{\mu}$ equivalent to $$\sum_{n\geq 1} n^{p-1}\lambda_f(n)<\infty?$$ Remarks: 1. If you want, assume that $f$ is finitely supported. This is: $\lambda_{f}(0)<\infty$.
- Since it is not clear to me whether $t\mapsto t^{p-1}\lambda_{f}(t)$ is decreasing (unless $0<p\leq 1$) I do not know whether the integral test applies.