Find the sum of all positive integers $n$ such that when $1^3+2^3+3^3 +\dots+ n^3$ is divided by $n+5$ the remainder is $17.$ 
Find the sum of all positive integers $n$ such that when $1^3+2^3+3^3 +\dots+ n^3$ is divided by $n+5$ the remainder is $17.$

Letting $k= n+5$ we get that $1^3+2^3+3^3 +\dots+ (k-5)^3 \equiv 17 \text{ (mod $k$)}$.
Knowing the sum of cubes formula we get that ($\frac{(k-5)(k-4)}{2})^2\equiv 17 \text{ (mod $k$)}$.
From here I'm not sure how I should continue. What would be my options?

From $$n\equiv -5 \pmod{n+5} \Rightarrow \\
n^2\equiv 25 \pmod{n+5} \Rightarrow\\
n^2+n\equiv 20 \pmod{n+5} \Rightarrow \\
(n^2+n)^2\equiv 400 \pmod{n+5} \Rightarrow \\
n+5 \mid 4\cdot\left(\frac{n^2(n+1)^2}{4}-100\right)$$
but we want
$$\sum\limits_{k=1}^n k^3=\frac{n^2(n+1)^2}{4}=Q\cdot (n+5)+17$$
or
$$n+5 \mid 4\cdot\left(Q\cdot (n+5)+17-100\right)=
4\left(Q\cdot (n+5)-83\right)\Rightarrow\\
n+5\mid 2^2\cdot 83$$
which yields the following options to check
$$n+5=83$$
$$n+5=2\cdot83$$
$$n+5=2^2\cdot83$$
The first two will satisfy the initial condition, so $n=78, n=161$.
