Welcome to BrainDen.com - Brain Teasers Forum

 Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account. As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends. Of course, you can also enjoy our collection of amazing optical illusions and cool math games. If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top. If you have a website, we would appreciate a little link to BrainDen. Thanks and enjoy the Den :-)
Guest Message by DevFuse

41 replies to this topic

#21 storm

storm

• Members
• 256 posts

Posted 18 March 2008 - 03:59 AM

Spoiler for At last I got it

• 0

#22 PhoenixTears

PhoenixTears

Junior Member

• Members
• 33 posts

Posted 18 March 2008 - 04:42 AM

Spoiler for response to solutions

• 0

#23 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 18 March 2008 - 05:51 AM

What prime number algorithm are you working with? Or is it a preset list?

I generate it using Eratosthenes's sieve ...

public List<int> GetPrimes(int limit){    int[] sieve = new int[limit];    List<int> found = new List<int>();    // initialise array    for (int i = 2; i < limit; i++) sieve[i] = i;    // find primes    for (int cursor = 2; cursor < limit; cursor++)    {        if (sieve[cursor] != 0)        { // found a prime            found.Add(cursor);            // Sieve the array            for (int j = cursor + 1; j < limit; j++)                if (sieve[j] % cursor == 0)                    sieve[j] = 0;        }    }    return found;}

• 0

#24 brhan

brhan

• Members
• 466 posts

Posted 18 March 2008 - 10:11 AM

Nice job DuhPuck and Storm

Lyrans become Masters at 45, sages at 605. Now for the grand slam, at what age would they die? Or will they ever die?

Edited by brhan, 18 March 2008 - 10:11 AM.

• 0

#25 PhoenixTears

PhoenixTears

Junior Member

• Members
• 33 posts

Posted 18 March 2008 - 03:34 PM

Spoiler for solution?

• 0

#26 brhan

brhan

• Members
• 466 posts

Posted 18 March 2008 - 04:42 PM

Spoiler for solution?

It is a good point your raised. Before I commented on that, lets see with what number will the programmers guru would come
• 0

#27 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 18 March 2008 - 04:49 PM

Spoiler for solution?

I just figured it out and hoped nobody had posted, but ... PhoenixTears beat me to it. Good job. Yep, the Lyrans will live forever. To put it simply ...
Spoiler for solution

Great problem. I kinda suspected there wasn't a solution when I didn't programatically find an answer under 10000000, but I didn't think it would be so simple to prove.
• 0

#28 brhan

brhan

• Members
• 466 posts

Posted 18 March 2008 - 05:19 PM

Hooray! I think anyways. This is the conclusion I reached....
So, to create a pattern where there are four consecutive years, it would go, odd even odd even or even odd even odd.
Anyways, there are two evens in there right?
Well, if you want to do the evens part, you have to have 2^2*a prime or prime^2*2
So then,
4*prime
2*prime^2
So then, the prime and prime squared should only be one number apart if they wanted consecutive even integers. However, since all primes except 2 are odd, it's not possible for those numbers to be only one apart.

It is a good reasoning, but it is not always true. Lets consider the following simple case. I will only focus on the two consecutive even integers part (special years according to the lyrians).
50 and 52 are two consecutive even special years to the Lyrians. 50=2*52 ... and 52=22*13.

So, still we can have two consecutive even numbers which fulfill the special years of Lyrians ... which means Lyrians may die (in our case 51 is not a prime number, but had it been that would be the end of Lyrians' life).
• 0

#29 scuttill

scuttill

Junior Member

• Members
• 78 posts

Posted 18 March 2008 - 07:14 PM

It is a good reasoning, but it is not always true. Lets consider the following simple case. I will only focus on the two consecutive even integers part (special years according to the lyrians).
50 and 52 are two consecutive even special years to the Lyrians. 50=2*52 ... and 52=22*13.

So, still we can have two consecutive even numbers which fulfill the special years of Lyrians ... which means Lyrians may die (in our case 51 is not a prime number, but had it been that would be the end of Lyrians' life).

Had 51 been a special number, it would've just meant a sage at age 52. To be the end of life, both 51 and 53 (or 49 and 51) would have to be special numbers for the "end of life" scenario.

Still working the math out on this to come up with a proof.
• 0

#30 brhan

brhan

• Members
• 466 posts

Posted 18 March 2008 - 07:20 PM

Had 51 been a special number, it would've just meant a sage at age 52. To be the end of life, both 51 and 53 (or 49 and 51) would have to be special numbers for the "end of life" scenario.

You are right. I was just focusing on the two special even years. Thanx for the correction.
• 0

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users