How could I evaluate this in code?
- by WM
There is a medieval puzzle about an old woman and a basket of eggs. On her way to market, a horseman knocks down the old woman and all the eggs are broken. The horseman will pay for the eggs, but the woman does not remember the exact number she had, only that when she took the eggs in pair, there was one left over; similarly, there was one left over when she took them three or five at a time. When she took them seven at a time, however, none were left. Write an application that can determine the smallest number of eggs the woman could have had.
It might be a multiple of seven because there are no eggs left when it's seven at a time. But I have a problem.
49 eggs -1=2*24
49 eggs -1=3*16
49 eggs-4=5*9
49 eggs-0=7*7