Camels and Bananas

Camels and Bananas

A banana plantation is located next to a desert. The plantation owner has 3000 bananas that he wants to transport to the market by camel, across a 1000 kilometer stretch of desert. The owner has only one camel, which carries a maximum of 1000 bananas at any moment in time, and the camel eats one banana every kilometer it travels.

What is the largest number of bananas that can be delivered at the market?

Hint: You can cache bananas in the desert.

This puzzle is from Volume 19, Number 1 of the Statistical Computing and Graphics Newsletter