Several papers are dedicated to the subject of integrals of functions that equal the sum of the same function, primarily for estimation purposes.
Boas and Pollard (1973) has some interesting sum-integral equalities:
$$\pi/\alpha=\sum_{n=-\infty}^\infty \frac{\sin^2 (c+n)\alpha}{(c+n)^2}=\int_{-\infty}^\infty \frac{\sin^2 (c+n)\alpha}{(c+n)^2}\, \text{d}n$$
$$\pi\operatorname{sgn} a=\sum_{n=-\infty}^\infty \frac{\sin (n+c)\alpha}{n+c}=\int_{-\infty}^\infty \frac{\sin (n+c)\alpha}{n+c}\, \text{d}n$$
It also gives several general formulae for functions that suffice:
$$\sum_{n=-\infty}^\infty f(n)=\int_{-\infty}^\infty f(n) \, \text{d}n$$
mainly with Fourier analysis.
This paper gives an equality with the Bessel J function:
$$\int_{-\infty}^\infty \frac{J_y (at) J_y(bt)}{t}\, \text{d}t=\sum_{t=-\infty}^\infty \frac{J_y (at) J_y(bt)}{t}$$
and some more references:
There have been a number of studies of this kind of sum-integral
equality by various groups, for example, Krishnan & Bhatia in the
1940s (Bhatia & Krishnan 1948; Krishnan 1948a,b; Simon 2002) and Boas,
Pollard & Shisha in the 1970s (Boas & Stutz 1971; Pollard & Shisha
1972; Boas & Pollard 1973).
See also Surprising Sinc Sums and Integrals which has some other equalities. This paper also states that (paraphrasing)
If $G$ is of bounded variation on $[−\delta, \delta]$, vanishes outside $(−α, α)$, is Lebesgue integrable over $(−α, α)$ with $0 < α < 2\pi$ and has a Fourier transform of $g$, then
$$\sum_{n=-\infty}^\infty g(n)=\int_{-\infty}^\infty g(x)\, \text{d}x+\sqrt{\frac{\pi}{2}}(G(0-)+G(0+))$$
Ramanujan's second lost notebook contains some sums of functions that equal the integral of their functions (Chapter 14, entries 5(i), 5(ii), 16(i), 16(ii)).
If you want, even more references with examples are in the papers I have mentioned.
Best Answer
We shall count the number of length $n+1$ sequences $(x_1,\ldots,x_{n+1})$ over a set of $n$ elements in two different ways.
The first is to just independently choose each $x_i$, yielding $n^{n+1}$ sequences.
Alternatively, let $x_{k+1}$ be the first repeated element in the sequence (a repetition must occur because the length of the sequence is greater than $n$). The first $k$ elements of the sequence can be chosen in $k!\binom{n}{k}$ ways (they must all be distinct), and $x_{k+1}$ can be chosen in exactly $k$ ways (choosing which of the first $k$ elements is repeated). The elements at the remaining $n-k$ positions can then be chosen in $n^{n-k}$ ways (there is no restriction on them). Multiplying these together and summing over $k$, we get
$$n^{n+1}=\sum_{k=0}^nk!\binom{n}{k}\cdot k\cdot n^{n-k}$$ $$1 = \sum_{k=0}^n \frac{k}{n}\binom{n}{k}\cdot\frac{k!}{n^k}$$ $$1=\sum_{k=1}^n\binom{n-1}{k-1}\frac{k!}{n^k}$$ which is exactly what we want.