Here is a slightly indirect way of obtaining the variance:
Let $X_k$ be the number on the $k$th ticket, $k=1,2,\ldots,m$.
So we have a uniform distribution for the $X_k$'s, namely
$$ P(X_k=j)=\begin{cases}\frac{1}{n}&,\text{ if }j=1,2,\cdots,n\\\\\,0&,\text{ otherwise }\end{cases}$$
So,
\begin{align}
\operatorname{Var}(X_k)&=E(X_k^2)-(E(X_k))^2
\\\\&=\frac{n^2-1}{12}=\sigma^2\,,\text{ say }
\end{align}
If the correlation between $X_i$ and $X_j$ $\,(i\ne j)$ be $\rho$, then $$\rho=\dfrac{\text{Cov}(X_i,X_j)}{\sigma^2}$$
You are looking for \begin{align}\operatorname{Var}(X)&=\operatorname{Var}\left(\sum_{k=1}^m X_k\right)\\&=\sum_{k=1}^m \operatorname{Var}(X_k)+2\sum_{i<j}\text{Cov}(X_i,X_j)\\&=m\sigma^2+2\binom{m}{2}\rho\sigma^2
\\&=m\sigma^2(1+(m-1)\rho)\tag{1}\end{align}
Now note that the joint distribution of $(X_i,X_j)\,,i\ne j$ is independent of $m$.
So we see that
\begin{align}
\operatorname{Var}\left(\sum_{k=1}^{\color{red}{n}}X_k\right)&=\operatorname{Var}(\text{constant})=0
\\&\implies\color{red}{n}\sigma^2(1+(\color{red}{n}-1)\rho)=0
\\&\implies\rho=\frac{1}{1-n}
\end{align}
Substituting this value of $\rho$ and the value of $\sigma^2$ in $(1)$, we finally get the variance of $X$ as
$$\operatorname{Var}(X)=\frac{m(n+1)(n-m)}{12}$$
x = replicate(10^6, sum(sample(1:10, 5))); mean(x); var(x)returns $E(X) \approx 27.5,$ which I hope matches what you have for the mean, and $V(X) \approx 22.95,$ which should be accurate to three significant digits. // Maybe you could generate more interest if you showed your method for the mean and discussed topics covered just before this problem appears. – BruceET Jun 11 '18 at 04:37vare 15 through 40, corresponding probabilities are $f=(1,1,2,3,5,7,9,11,14,16,18,19,20,20,19,18,16,14,11,9,7,5,3,2,1,1)/{10\choose 5}.$ Then $\mu$ issum(f*v)=27.5, and $\sigma^2$ =sum(f*v^2) - 27.5^2= 22.91667. – BruceET Jun 11 '18 at 05:46