Solution for $n$ bananas, where $n$ is the number of bananas you own, and $c$ is the number of bananas the camel can carry:
- For bananas $0 \rightarrow c$ the cost to move a banana is $1$ banana per kmmile.
- For bananas $c+1 \rightarrow 2c$, the cost to move a banana is $3$ bananas per kmmile.
- For bananas $2c+1 \rightarrow 3c$, the cost to move a banana is $5$ bananas per kmmile.
- etc.
This is because, if the camel moves the bananas 1 kmmile at a time, he needs to make two trips for each load beyond his current capacity.
Define $t = \lfloor\frac{n}{c}\rfloor$ Therefore, the total number of miles the camel can reach is:
$$\left(\sum_{k=1}^{t} \frac{c}{2k - 1}\right) + \frac{(n \bmod c)}{2t+1}$$
In particular, plugging in the given $n = 3000$ and $c = 1000$, we have that the camel can travel
$$1000 + 333 + 200 = 1533 \text{ miles}$$
To figure out how many bananas remain for a given distance,
Subtract the extra miles and multiply back at the rate given above.
For the first $1000$ miles, this number is just the distance beyond the total capacity:
$1533 - 1000 = 533$, or 533 bananas.