Berma calculation
-
- Posts: 49
- Joined: Fri Jul 02, 2010 9:34 pm
- Location: Egypt
- Contact:
Berma calculation
In our Tradition there is a story that says
There was a lady with a some eggs
she was walking to sell them when suddenly a man on a bike hit her
she started to cry beside the road the man tried to make her calm down (in other words :shut up)
he told her that he can pay for her
she told him that she didn't know how many eggs she had but she also told him that when she was counting them 2 by 2 there was one egg remaining
and when she counted them 3 by 3 there was still one egg remaining
and when she counted them 4 by 4 there was still one egg remaining
and when she counted them 5 by 5 there was still one egg remaining
and when she counted them 6 by 6 there was still one egg remaining
but when she counted them 7 by 7 there was no egg remaining
The man couldn't solve the question he wanted some help
Can you give him some help?
There was a lady with a some eggs
she was walking to sell them when suddenly a man on a bike hit her
she started to cry beside the road the man tried to make her calm down (in other words :shut up)
he told her that he can pay for her
she told him that she didn't know how many eggs she had but she also told him that when she was counting them 2 by 2 there was one egg remaining
and when she counted them 3 by 3 there was still one egg remaining
and when she counted them 4 by 4 there was still one egg remaining
and when she counted them 5 by 5 there was still one egg remaining
and when she counted them 6 by 6 there was still one egg remaining
but when she counted them 7 by 7 there was no egg remaining
The man couldn't solve the question he wanted some help
Can you give him some help?
Devilish Angel Aghamemnon
-
- Posts: 49
- Joined: Fri Jul 02, 2010 9:34 pm
- Location: Egypt
- Contact:
-
- Posts: 49
- Joined: Fri Jul 02, 2010 9:34 pm
- Location: Egypt
- Contact:
This python code shows me all solutions in range 0..9999:
If you like math, you can prove that { 301+k*420 for k=0,1,2,3,... } is the set of all solutions.
So, the minimum number of eggs is 301.
Code: Select all
for n in range(10000):
s = sum((n-1)%m for m in range(2,7))
if s==0 and (n%7)==0:
print n
So, the minimum number of eggs is 301.
-
- Posts: 49
- Joined: Fri Jul 02, 2010 9:34 pm
- Location: Egypt
- Contact: