Page 1 of 1

Berma calculation

Posted: Mon Sep 20, 2010 10:23 pm
by Aghamemnon
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?

Posted: Tue Sep 21, 2010 8:05 am
by jeetee
49

In between boring and excellent having a major touch of easy.

Posted: Tue Sep 21, 2010 7:05 pm
by Aghamemnon
I know It's quite easy to solve it by computer it took me only 0.00000000000000000000000001 secs
but it was in our tradition before even invention of computer
so have a try and and solve it by hand

Posted: Thu Sep 23, 2010 7:15 am
by jeetee
I did solve it by hand, coding this up takes longer..

My answer is that small dot in my first reply, so it wouldn't spoil this riddle for others.

*Oh great Adum,
heed thy members
and bless us with spoiler tags*

Posted: Thu Sep 23, 2010 9:36 am
by b0bA
@jeetee:

your answer is wrong. try your solution for the 5 by 5 part.
the 1st answer is between lcm(2,3,4,5,6) and lcm(2,3,4,5,6,7).
all other solutions can be achieved by adding multiples of lcm(2,3,4,5,6,7) to the 1st answer.

Posted: Wed Oct 06, 2010 11:32 pm
by Meelo
Couldn't the answer just be any of the following small text?
7, 49, 63, 77, 91, 221, or any other multiple of 7 not divisible by 2, 3, or 5?

Posted: Thu Oct 07, 2010 12:17 am
by gfoot
It depends whether "still one egg remaining" means there might be more than one. Either way, though, it's true that there's no single solution.

I suspect she was lying anyway - even the smallest solution is quite a lot of eggs.

Posted: Fri Oct 08, 2010 11:05 pm
by Aghamemnon
Come on pals the answer is not
49

In between boring and excellent having a major touch of easy.
Have you checked the answer after getting it divide it by 5

Are you real hackers?
Solve it because I got upset

Posted: Sat Oct 09, 2010 1:52 pm
by efe
This python code shows me all solutions in range 0..9999:

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
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.

Posted: Sat Oct 09, 2010 8:34 pm
by Aghamemnon
This is the reply I was waiting for not just random numbers
Thanks efe

Answer

Posted: Sat Oct 09, 2010 9:22 pm
by nidsche
Well the answer is the chinese reminder theorem.

And maybe 42