A wealthy merchant arranged a large caravan of camels loaded with various goods?
The goods vary from sacks of cheap hay to bags of valuable jewelry, so for convenience of accounting the merchant loaded
1st camel with 10dinar worth of goods,
2nd camel with 20dinar worth of goods,
3rd camel with 30dinar worth of goods,
and so on, each next camel carries 10 dinar worth of goods more.
http://www.ngsprints.co.uk/images/M/756029.jpg
The merchant must pay duty 1 dinar per camel, so at the city gates he declared that he had 450 camels and paid 450 dinars tax, and (plus) gave the tax collector 50 dinars bribe.
The tax collector was very pleased with the bribe, and asked the merchant:
“How do you manage to oversee such huge amount of goods during the jorney?”
The merchant replied honestly:
“Simple. I ride on one those camels, chosen so that the same amount worth of goods is in front of me, as amount worth of goods behind me”
How much money did the merchant save by bribing the the tax collector?


October 4th, 2008 at 10:40 am
Let’s suppose there were N=n+k camels, and he was riding on the n_th camel. There are n-1 in front of him and k behind him.
The value of goods on all the camels is
10*(n+k)*(n+k+1)/2
The value of goods on his camel is 10*n
Value of goods in front is
10*n*(n-1)/2
We require that
10*(n+k)*(n+k+1)/2 - 10*n = 2* 10*n*(n-1)/2
(n+k)*(n+k+1) = 2n^2
N^2 + N - 2n^2 = 0
This means 1 + 8n^2 is a perfect square
and 2N + 1 = √(1 + 8n^2) …(*)
The convergents to Pell’s equation x^2 = 1 + 8y^2 are
(3,1), (17,6) and (99,35).
I don’t think there are any higher than this.
So the maximum case would be n = 35,
2N + 1 = 99 or N = 49
This would mean the merchant lost 451 dinars.
I don’t know if the question is worded correctly. I’m getting that there are 49 camels with a total of 12250 dinars worth of goods.
***EDIT***
The 3rd answerer seems to be getting a reasonable answer, but he assumes that the merchant’s camel, the 493rd has no goods. It looks like that’s the only way this could work. If that’s what the question intended, it should have said so. Instead the question said “each next camel carries 10 dinar worth of goods more”. The merchant also said “I ride on one of THOSE camels”. This means the 493rd camel should have carried 4930 dinars worth of goods.
I might as well one up him and say the answer is 196.
He rides on the 493rd camel, which has 4930 dinar of goods, but he placed the goods at the back of the camel, so technically it’s behind him. This way there are 696 camels, all loaded according to the wording of the problem.
The bribe saved him 196 dinars.
**EDIT**
Right manjomesando. I made a stupid error in applying the recursion formula. There are indeed infinite solutions to the Pell equation. The answer could have also been N = 1940449, with the merchant riding the 1372105th camel. But that would have been unreasonably high.
October 5th, 2008 at 6:27 am
197 dinars
The first solution makes unwarranted assumptions — that there must have been so many in front of him. Nothing suggests such a thing — only that he declared 450 camels.
It’s far easier to use Excel to brute force the answer. It’s obvious he had more than 500 camels since there would have been no point in paying a bribe. And it’s obvious that he couldn’t have had more than some arbitraty number, or the tax collector wouldn’t have been very happy. I chose 1000, but could have easily done far more.
This is much easier if we assume that there was no cargo on the camel the merchant was riding.
So just make a table of numbers from 1-1000 and the associated cumulative value (ya’ really only need the numbers over 500, but it’s an easy way to get the cumulative value associated with 500; and there’s no point in throwing in the 10 dinars — it’s just a constant). For each number, it’s easy to figure the midpoint of the cumulative value. Obviously, half the total value is loaded on the camels in front of the merchant, and half on the camels behind.
The trick then is to partition and test. The ‘match’ function can be used to partition the N camels into 2 sets by finding the approximate midpoint in the list of cumulative values. Find the cumulative value of each partition, and the difference between.
The only value of N (>500) where the partitions are exactly equal is 696. There will be 492 camels in front of the merchant and 204 behind him. Including the ridden camel, there were 697 total. Since he paid 500, he saved 197.
October 6th, 2008 at 11:50 pm
so the merchant has more than 500 camels, right?
let’s say he rode the nth camel.
front are 1st till (n-1)th, and back are (n+1)th till pth, p > 500.
(n-1)[1+(n-1)]/2 = (p-n)[(n+1)+p]/2
n(n - 1) = (p - n)(p + n) + p - n = p^2 - n^2 + p - n
2n^2 = p(p + 1)
(p + 1/2)^2 = 2n^2 + 1/4
(2p + 1)^2 = 8n^2 + 1
letting P = 2p + 1,
P^2 = 8n^2 + 1
{
x^2 = 1 + 8y^2 are
(3,1), (17,6) and (99,35).
}
the above are from Dr. D’s answer.
but i got (n,P) = (204,577) too.
and then some more.
(n,P) = (1189,3363) and (6930,19601)
formula is n(k+1) = 2*[P(k)] + n(k-1).
OR P(k+1) = 6*[P(k)] - P(k-1)
for p > 500, P = 2p+1 > 1001.
we get the minimum P = 3363.
p = (P-1)/2 = 1681
the merchant had 1681 camels in all.
he saved = 1681 - 450 - 50 = 1181 dinars.
answer = 1181 Dinars, riding the 1189th camel.