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

#31 woon

woon

Senior Member

• Members
• 2443 posts

Posted 18 March 2008 - 08:30 PM

Spoiler for I only got for Master and Sage

• 0

#32 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 19 March 2008 - 12:38 AM

It is a good reasoning, but it is not always true. ...
So, still we can have two consecutive even numbers which fulfill the special years of Lyrians ... which means Lyrians may die.

I'm not sure how I missed that, since I had in front of me several sets of "sage-making" special years with consecutive evens (They're rare, however. The only sets under 1000000 are 7442,7443,7444; 20402,20403,20404; 243602,243603,243604; 647522,647523,647524)

So, our logic would hold true for avoiding three consecutive evens, since either p or q would have to repeat the 2, and there wouldn't be a corresponding q or p to satisfy the equation, but that only prevents you from having six consecutive special years. My gut feeling is that it's still impossible, but I won't be able to prove that programatically. In case it helps anyone else to see a pattern, there's a good-sized list of sequences of three special years in the spoiler (most of the sets under 1000000).

Spoiler for lotta numbers

Edited by Duh Puck, 19 March 2008 - 12:43 AM.

• 0

#33 brhan

brhan

• Members
• 466 posts

Posted 19 March 2008 - 11:22 AM

So, our logic would hold true for avoiding three consecutive evens, since either p or q would have to repeat the 2, and there wouldn't be a corresponding q or p to satisfy the equation, but that only prevents you from having six consecutive special years.

That is pretty correct. Actually, the Lyrians dies ... that is, we can have four consecutive special years. I will wait in case someone comes up with the solution. Otherwise, I will post the solution tomorrow.
• 0

#34 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 19 March 2008 - 02:22 PM

That is pretty correct. Actually, the Lyrians dies ... that is, we can have four consecutive special years. I will wait in case someone comes up with the solution. Otherwise, I will post the solution tomorrow.

Well, shoot. In that case I'll give it one more run tonight using significantly improved algorithms for testing primality (the same ones used for RSA encryption techniques). I just downloaded the code and tested and it turns out that the increase in time for generating a list of prime numbers is almost linear to the number of elements, while my previous method was logarithmic, which caused me to hit barriers much sooner. I just generated primes up to 1,000,000 in about one minute, meaning I should be able to reach about 500,000,000 overnight. Also, I think I can wrap the special age test in the same loop I'm using to generate the primes, which means I won't have to wait to verify output. I can't wait to get home and try it!

My prediction is that if Lyrians die before the age of 500,000,000, I'll tell you by tomorrow. If it's bigger than that, hey, they might as well be immortal.
• 0

#35 brhan

brhan

• Members
• 466 posts

Posted 19 March 2008 - 02:38 PM

Well, shoot. In that case I'll give it one more run tonight using significantly improved algorithms for testing primality (the same ones used for RSA encryption techniques). I just downloaded the code and tested and it turns out that the increase in time for generating a list of prime numbers is almost linear to the number of elements, while my previous method was logarithmic, which caused me to hit barriers much sooner. I just generated primes up to 1,000,000 in about one minute, meaning I should be able to reach about 500,000,000 overnight. Also, I think I can wrap the special age test in the same loop I'm using to generate the primes, which means I won't have to wait to verify output. I can't wait to get home and try it!

My prediction is that if Lyrians die before the age of 500,000,000, I'll tell you by tomorrow. If it's bigger than that, hey, they might as well be immortal.

ok ... I am sure you will get it. Just one comment, the number is much bigger ... I am not sure about your algorithm, but if possible try to start it with a big number in order to cut some iterations of lower value. I have put the range as a hint in the spoiler.

Spoiler for Lyrans die in the range of ...

• 0

#36 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 19 March 2008 - 08:10 PM

ok ... I am sure you will get it. Just one comment, the number is much bigger ....

Well, by doing prime factorization and ruling out a lot of non-possibilities, I got it faster, but not that much faster! It looks like I'll get up through about 2 billion by tomorrow, but unfortunately I can't start at a higher number, since I need an in-memory list of primes to efficiently do factorization. I think I'll eventually get it, but it would be nice to see a more elegant approach.
• 0

#37 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 21 March 2008 - 04:14 PM

Woohoo! I realized some significant changes I could make to optimize the program, after which it solved the problem in 11 mins.

Spoiler for Program output

• 0

#38 ALFRED

ALFRED

Junior Member

• Members
• 54 posts

Posted 21 March 2008 - 04:52 PM

brhan - this is a very cool original puzzle.
• 0

#39 brhan

brhan

• Members
• 466 posts

Posted 21 March 2008 - 04:56 PM

Woohoo! I realized some significant changes I could make to optimize the program, after which it solved the problem in 11 mins.

Spoiler for Program output

Here we go .... the Grand Slam title of the Lyra III goes to ... Duh Puck. Well done.

Spoiler for Lyrans die at the age of ...

Edited by brhan, 21 March 2008 - 04:58 PM.

• 0

#40 Duh Puck

Duh Puck

• Members
• 445 posts

Posted 21 March 2008 - 04:57 PM

brhan - this is a very cool original puzzle.

Agreed. I'm curious how you came up with the idea for this one. I'm still assuming there's a swank mathematical proof for arriving at the result in a much more efficient manner than brute force, but there must have been an AHA! moment when you saw or discovered some pattern and realized it would make for a cool puzzle.
• 0

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users