|
| |
| The Most Complete Mailing Lists, Groups and Newsletters System on the Net | |
| HOME SERVICES SOLUTIONS COMPANY | |
|
BEFORE ANYTHING ELSE, we'd like to say that we don't like being spoilers of anything. In fact, we hate spoilers. We ourselves worked out our way to solve this problem, and after finding the solution, the next day we did a search in Google for the funny 7427466391 number, and realized there had been a spoiler in some blog I don't even want to remember its name, hours before we submitted our response to Google (no, we did not send our resume, just the fact we've came up with the solution :-)... But obviously, the moment there's one site with the answer posted out there, anything else that comes after that is just useless... The only reason we're posting this here now is because there's a spoiler out there already. Otherwise you wouldn't be seeing this here. We respect Google and hope they come up with more fun and interesting challenges and puzzles like this one, whether it's to recruit people or just for the fun of it, and we'll never post a spoiler unless some smartie had done it already somewhere else. Having said that, let's get to work...First of all you probably know by now that the {first 10-digit prime found in consecutive digits of e}.com resolves to 7427466391. However chances are you found out that by looking at it at some web site. But assuming you have no Internet, this is the first data you need to obtain. Certainly I wouldn't suggest doing this by hand, so, how could you do it? Before we get our hands dirty, let me say that you can really do this with a lot of different languages/compilers and what not. Some may want to use Python (one of the easiest languages one can write), or Mathematica (that's what it's for), but here we'd decided to go with C, well, don't really ask me why, we're that obtuse! ;-) In any case, if you can read C, I'm sure that porting this to your favorite language will be piece of cake. So since we're going to use C, we'll assume you have a standard C compiler on a 32 bit machine. First, you need to write some program to output enough digits of e so that you'll find an answer. This little program will do the trick:
Compile and run this program and you'll get enough digits in e for solving this problem. In fact, you'll get a whole lot more digits than what you'd need, so save it as it may come handy for future challenges :-) Now, you need some function to identify if a number is prime or not. This can be really tricky for very large numbers, but well, we're dealing with a 10 digit number, that's large but not too big, right? :-) And because we're assuming we're working with a 32 bit machine, we'd better make sure we use the right numeric type (that'll be "long long" by the way). This function can determine whether a number is prime or not with enough accuracy for our purpose here:
Simple, huh? So with enough digits from e and a function to identify whether a number is prime or not, it'd be really trivial to find out what's the first 10-digit prime found in consecutive digits of e. Do we need to write the code for you? Probably not, but here goes one out of a million ways it can be done ;-)
(now the Python people must be having a ball, hey, that's why you switched to Python in the first place, right? :-) Anyways, compile it, run it, and voila! There it goes your 7427466391.com So now we are where you already knew you were :-) Now for the second part of the problem:
f(1)= 7182818284 The first three numbers certainly have something in common. If you look at the sequence of digits in e, the first falls in the ordinal position 1, the second in position 5, and the third in position 23. These all are prime numbers. There are other interesting things one can deduce from this sequence, but the truth is, they don't matter much in the end, so we'll spare you the details. From here, it really gets tricky. A lot of different things could make sense. However, the f(4) really seems to be out of place. It falls under position 99 which is not a prime. What the...? And here's the trick! Really, because the first three numbers can lead to several different logic explanations, one needs to find what all these four numbers have in common... And the only thing they seem to have in common is... the digits of each number added individually, sum 49. So one could guess.. Should we find the next 10 digit sequence in e whose digits added individually total 49? Well, yes but not so fast. Because the 4th number is the answer to the previous question, we should think that the first three numbers are telling us something else besides their digits add to 49. And we do know that something else: that they all fall in prime positions! So, why don't we write a little program that finds 10-digit sequences from e , whose individual digits add to 49, and whose ordinal position falls on a prime number? Fair enough:
Once again, Python programmers must be having a really good time :-) But regardless, compile this, run it, and this is the output you get:
Value 1 (1) = 7182818284 Our friends from f(1), f(2) and f(3) show up happily at the beginning. Well, maybe we should try our luck with the next value, don't you think so? And that's it. It wasn't that hard, was it?
|
|
|
| Services: | List Hosting Services, Products, Industry Solutions |
| Your Account: | Sign Up, My Lists, My Preferences, Online Help |
| General: | About Us, News, Privacy Policy, No spam, Contact Us |
eListas is a registered trademark of eListas Networks S.L.
Copyright © 1999-2005 AR Networks, All Rights Reserved
Terms of Service