He would need to make at least 3 trips to market to deliver all the cacti to be sold.
If he carries the maximum of 10 cacti to market, he loses one cactus during the first mile, two during the second mile and ten in the last mile so he has no cacti to deliver for sale. So he loses all the cacti on each trip. If he carries less than 10 cacti he will lose all of them before he gets to market.
Only if he can carry more than ten can he deliver some cacti for sale.
However, there is a way he can get 6 cacti to market:
He carries 10 cacti up to the 7th mile, so because of losses on the way, he ends up with only 3 cacti.
He goes back for another 10 and takes them the same distance. Now he has 6 cacti. He goes back to collect the final 10 cacti and when he gets to mile 7 he has 9 cacti and three miles to go. He can carry all 9 cacti, but loses 3 by the time he gets to market, so he has 6 cacti that can be sold.
If he stops off at mile 6 he ends up with 12 cacti, but he can only carry 10 of these the remaining 4 miles, so he loses 4 on the way and ends up with 6 again. The remaining 2 can’t be delivered because both would be lost on the way.
If he stops off at mile 5, he ends up with 15 cacti. He carries 10 to market and loses 5 on the way, so there will only be 5 to sell. The remaining 5 are completely lost.
If he stops off at mile 3, he ends up with 21 cacti. He discards one to leave 2 batches of 10. On taking the first batch he will lose 7 cacti, and deliver 3. Repeating this with the next batch he will deliver another 3, making 6 in all.
Therefore, he can get 6 cacti to market at most.
If M(x) is a function based on stop-off points, determining how many cacti would be delivered to market, where x=[0,10], then M(x)={0 2 4 6 4 5 6 6 4 2 0}, where x=0 is the starting point and 10 is the market.