Lets get geeky!

Did you know? - My mom is a maths teacher! Well, it doesn't mean anything like I'm a genius in maths :P . In this vacation the Kerala government is conducting funny courses to the teachers in all subjects to train them the new aspects of revised syllabus. The teachers are actually divided into groups, given assignments, some tricky questions and even homeworks!

Now today.. mom came up with two tricky questions.

Q #1Take 4 numbers.

The sum of the first two numbers should be double the sum of the other two.

But the product of the first two should be half the product of the other two.

Actually we can find more than one set of such numbers.

Eg: 33 1, 11 6

33+1=34

11+6=17=2 x 34

33 x 1 = 33

11 x 6 = 66 =2 x 33

Got it?!

To solution..Okey, so we burned our brains on various combinations of numbers, looking out for general properties and all. Not to mention we ended up with nothing more. :(

And then this thought struck me "Why don't I leave it to the computer?"

I wrote a very simple program in Java and amazingly the computer showed me a list of such numbers satisfying the above condition!

Below is the algorithm behind it..

for(a=1;a<=50;a++)

for(b=1;b<=100;b++)

for(p=1;p<=50;p++)

for(q=1;q<=2*p;q++)

if(a+b==2.0*(p+q) && a*b==p*q/2.0)

// Print a,b, c,d

The numbers that we needed(below 100) are..

1 33 , 6 11

1 45 , 18 5

2 60 , 15 16

2 66 , 12 22

2 90 , 36 10

3 91 , 21 26

3 95 , 30 19

3 99 , 33 18

When was I ever gonna find 'em without my computer? After all.. studying Java at school proves a little useful! :O

Q #2Let us think (a + b) x a x b = 4545

The question is that "Are a and b natural numbers?"

To solution..This time I left it to the computer with no other option!

The idea was to check all combinations of a and b where I ranged

a from 1 to 50, and

b from 1 to 200. But none of them gave 4545. So they must be some fractions!! :D

Now I made a program to check fractions in an attempt to find a and b. But I failed in this attempt. So far no such a and b exists :( .

Can you find them??

The algorithm used to find a and b is as follows..

for(a=.01;a<=50;a+=0.001)

for(b=1;b<=200;b+=0.001)

if((a+b)*a*b==4545)

//Print a,b

//Print "Over!"

I really think no such numbers exist!