Berma calculation

Discussion about hacker.org's server
Post Reply

What do you think about this tiny challenge

Poll ended at Thu Sep 30, 2010 10:23 pm

booooooring
2
67%
excellent
1
33%
 
Total votes: 3

Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

Berma calculation

Post 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?
:twisted: Devilish Angel Aghamemnon :twisted:
jeetee
Posts: 105
Joined: Sun Jan 04, 2009 5:25 pm

Post by jeetee »

49

In between boring and excellent having a major touch of easy.
Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

Post 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
:twisted: Devilish Angel Aghamemnon :twisted:
jeetee
Posts: 105
Joined: Sun Jan 04, 2009 5:25 pm

Post 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*
b0bA
Posts: 13
Joined: Tue Dec 30, 2008 4:45 pm

Post 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.
Meelo
Posts: 9
Joined: Sat Apr 25, 2009 11:10 pm

Post 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?
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post 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.
Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

Post 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
:twisted: Devilish Angel Aghamemnon :twisted:
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post 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.
Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

Post by Aghamemnon »

This is the reply I was waiting for not just random numbers
Thanks efe
:twisted: Devilish Angel Aghamemnon :twisted:
nidsche
Posts: 2
Joined: Fri Mar 06, 2009 11:10 am

Answer

Post by nidsche »

Well the answer is the chinese reminder theorem.

And maybe 42
Post Reply