There is a medieval puzzle about an old woman and a large 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 pairs, there was one left over; similarly, there was one left over when she took them three, four, five, or six at a time. When she took them seven at a time, however, she came out even.
Write a Java program to determine the smallest number of eggs the woman could have had.
You don't need to appy the condition taht when taken in pair then one is left over. Because, if taken 4 then one is remaning then when taken in 2 will always leave one. Same goes with taken 3 and 6 at a time. Answer is 301.