This problem is a harder variation of A tale of The Rich Arab Man, which - though phrased very similarly - needs a different method to solve.

A very rich pearl harvester had four wives. His first wife had four kids, the second wife had three kids, third wife had two kids and the last young wife had a single kid.

One day he decided to give away all his pearls to his wives.

He carried all those pearls in a huge bag and entered the house of his first wife. Upon arrival, the four kids quickly picked one pearl for each of them from the bag and ran away. Then he told his intention to his wife. She counted and took for herself a quarter of the pearls in the bag and returned the remainders to him to be shared with the other ladies.

He carried the bag and entered the house of his second wife. Quickly three kids jumped in and get away with a pearl for each of them. After that, knowing the man's intention, his second wife took a quarter of the pearls and returned the balance to be shared with the other ladies.

He then went to the third wife. Two kids grabbed a pearl for each of them and went missing. After that, the lady of the house took a quarter of the pearls and gave the balance to him.

When he walked into the last wife, he gave a pearl to the single kid in that house. The lady took the quarter of what left in that bag.

When he walk out from that house, the pearl harvester found the remaining quantity of the pearls was exactly divisible by four. Then he divided the pearls into four equal numbers and gave away to each wife separately.

What was the initial number of pearls in the bag carried by him.?

  • 7
    $\begingroup$ This is practically a carbon copy of this question. The only difference is that there are now 10 children taking some of the items before the wives do. $\endgroup$
    – dcfyj
    Aug 30, 2016 at 18:35
  • $\begingroup$ @GentlePurpleRain (and all the other VTCers), I don't think this is a duplicate. I am not aware of any solution that is analogous with the one the so-called duplicate has. Can you give some detailed reasons for the votes? Thanks in advance! $\endgroup$
    – elias
    Aug 30, 2016 at 19:43
  • $\begingroup$ @elias I believe you're correct. I didn't read the question carefully enough, and thought the children only factored in at the very beginning. This is a different problem than the last. (Although still similar.) $\endgroup$ Aug 30, 2016 at 19:45
  • 1
    $\begingroup$ Why this question is voted down? Is it because it's similarity to the A tale of rich Arab man? Or its too tough for a puzzle? $\endgroup$ Aug 31, 2016 at 4:55
  • 1
    $\begingroup$ @soosaisteven, I think downvoters don't realize that this version is indeed different from the other puzzle. $\endgroup$
    – elias
    Aug 31, 2016 at 7:01

3 Answers 3


I think he had

1000 pearls.

The children of the first wife take 4, leaving him with


The first wife gets one quarter of the rest, so there are

747 left.

Then the children of the second wife take 3, so

744 remain.

The second wife gets the quarter of them, but there are still


The third wife's children take away 2, he still has


After the third wife gets her quarter,

417 pearls stay in the bag.

The last child gets 1,

416 pearls remain.

The last wife gets the quarter of that, leaving him with


Which can be divided into 4 equal parts of


I found this by

solving the following congruence:
which I got by assuming he has $x$ pearls in the beginning, keeping track how many he has left in each step, and note which amounts have to be divisible by 4. All the equations that came up in the middle were:
but these are automatically satisfied by the solution of the former one.
The congruence can be solved the following way:
First by multiplying both sides (and also the modulus) by 256 and adding 1128 to both sides, we get
Then with the extended Euclidean algorithm, we only need to find the multiplicative inverse of 81 mod 1024. Or we have to find an online tool to realize it's 177.

Because of the modular arithmetic, every other number of the form $1000+1024k$ (where $k\in\mathbb{N}$) is a possible other solution, although obviously not minimal.


The man must have had

$1024 q + 1000$ pearls for any postive integer $q$, and so the smallest number he could have had at the start was 1000.


At the end, he was able to divide the remaining pearls among the wives. So he must have had $4n$ pearls for some $n$.

Before he visited his fourth wife, he therefore had $\frac{4}{3} (4n) + 1$ pearls; when the child took one of these and the fourth wife took 1/4 of the remainder, he would have had $4n$ left over.

Similarly, before he visited his third wife, he would have had $\frac{4}{3} \left( \frac{4}{3} (4n) + 1 \right) + 2$ pearls.

Similarly, before he visited his second wife, he would have had $\frac{4}{3} \left( \frac{4}{3} \left( \frac{4}{3} (4n) + 1 \right) + 2 \right) + 3$ pearls.

Finally, when he started, he would have had $\frac{4}{3} \left( \frac{4}{3} \left( \frac{4}{3} \left( \frac{4}{3} (4n) + 1 \right) + 2 \right) + 3 \right) + 4$ pearls.

Multiplying this all out, we find that the man must have had $m = (1024 n + 1128)/81$ pearls to begin with. Thus, we must have $1024 n + 1128 = 81 m$ for some other integer $m$, or $1024 n - 81 m = -1128.$ You can use the Extended Euclidean Algorithm to solve this equation; what you find is that $1024 \times (78 + 81 q) - 81 \times (1000 + 1024 q) = -1128$. Thus, the original number of pearls must have been $m = 1024 q + 1000$ for some integer $q$.

  • $\begingroup$ Note that the technique here is slightly different from @elias's answer, but the techniques used are much the same. $\endgroup$ Aug 31, 2016 at 15:56

The answer is



$312\div 4=78$, so, on his second round, the man gives $78$ pearls to each wife.

Unfortunately, I solved this by computer-assisted brute force, so I don't have any proof that this is the minimum.

  • $\begingroup$ I just checked all the final numbers ( the ones he gives to his wives once everything is done) and no final number than the one you found works. They all have decimals at some point. $\endgroup$
    – dcfyj
    Aug 30, 2016 at 19:27
  • $\begingroup$ The problem have infinite possible answers, not just 1000...!! $\endgroup$ Aug 30, 2016 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.