This is similair to shinny's solution. He takes 1000 apples and carries them 1km, then goes back for the next 1000 and carries them 1km, then the last lot carries 1km. So by travelling 1km he loses 3 apples. He loses 1000 apples by travelling 1000/3 km. At this point, he only requires two back trips. And so he just takes one lot, goes back for the other and carries that 1km as well, so he is losing 2 apples per km. until 1000/2=500 km later where he has 1000 apples, and now he only does not have to return, but just go straight there, hence the total apples he comes back with is 1000-(1000 - (1000/3 + 500)).
Note how this is equivalent to evaporade's method, just in a different order ie: instead of going back for each load after 1km, why not 0.5km? 0.1, or even the whole 1000/3 since it's all quite arbitrary. This is because you will lose those apples in the second load by one 333.3 km of trip as much as you will by 333.3 lots of those smaller 1km trips.