As you've said in one day a man can complete $\frac{1}{500}$ of the job.
The amount of work done every 10 days is then given by $\frac{1}{500}\times10\times(30-5t)$ where $t$ is how many lots of 10 days have passed (starting from $t=1$).
Adding this from $t=1$ to $t=n$ gives:
$$\sum_{t=1}^n\frac{1}{500}\times10(30-5t)=\sum_{t=1}^n\frac{3}{5}-\frac{1}{10}t$$
$$=\frac{3}{5}n-\frac{1}{20}n(n+1)$$
$$=\frac{11}{20}n-\frac{1}{20}n^2$$
Then we need to solve this equal to $1$ to complete the job.
$$1=\frac{11}{20}n-\frac{1}{20}n^2$$
$$n^2-11n+20=0$$
$$n=\frac{11\pm\sqrt{11^2-4\times1\times20}}{2}$$
$$n=\frac{11\pm\sqrt{41}}{2}$$
$$n\approx2.3,8.7$$
So the job will get completed in between 20 and 30. To work out exactly we need to do the individual sums.
First ten days: $\frac{1}{500}\times10\times25=\frac{1}{2}$
Second ten days: $\frac{1}{500}\times10\times20=\frac{2}{5}$, total so far: $\frac{9}{10}$.
Remaining: $\frac{1}{10}$. Days needed for this: $\frac{1}{500}\times15\times n=\frac{1}{10}$ gives $n=\frac{10}{3}$ so $3$ and $\frac{1}{3}$ days.
So the total is $23$ and $\frac{1}{3}$ days.