{ First 10 digit prime in consecutive digits of e }.com

| 31 Comments | 1 TrackBack

Ok, this is not a new one, but just for those who somehow missed it (just like me).
A cool puzzle to solve: { First 10 digit prime in consecutive digits of e }.com

How much time does it take for you to crack it? My full time is about an hour (I'm not so good on sequences apparently).

PS. Try not to google for hints.
PPS. Please no spoilers in comments.

Related Blog Posts

1 TrackBack

TrackBack URL: http://www.tkachenko.com/cgi-bin/mt-tb.cgi/260

TITLE: High-performance XML (IV): subtree transformations without re-parsing URL: http://weblogs.asp.net/cazzu/archive/0001/01/01/164243.aspx IP: 66.129.67.202 BLOG NAME: DATE: 07/12/2004 07:47:45 AM Read More

31 Comments

Here is my solution to the first 10 digit prime in e question. Note, my solution is built for speed not for readability! It is based upon Eratosthenes Sieve method for finding primes.

s=Timer()
Dim a(100000)
r=Round(Sqr(100000))
For p=2 To r
While a(p)=True
p=p + 1
Wend
x=p * 2
While x a(x)=True
x=x+p
Wend
Next
e="2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668082264800168477411853742345442437107539077744992069551702761838606261331384583000752044933826560297606737113200709328709127443747047230696977209310141692836819025515108657463772111252389784425056953696770785449969967946864454905987931636889230098793"
For p=1 To Len(e)-9
c=Mid(e,p,10)
b=True
For x=2 To 100000
If a(x)=False Then
r=CDbl(c)/CDbl(x)
If r=Round(r) Then
b=False
Exit For
End If
End If
Next
If b=True Then
MsgBox c & " is the first 10 digit prime in e at p:" & p & vbCrLf & "done in : " & Timer() - s & " seconds"
WScript.Quit
End If
Next

Someone knows how to read Time magazine!

This is actually a recuiting tool for the Google Company, found on Route 101

I do thank this site for the insight provided for the first 10-digit prim found in consecutive digits of e.com. It is great to see that I am not the only one boggled by this question. You have indeed confirmed my findings. 7427466391.com
Thank you Robert Malzahn

2^30+7=prime? i don't understand...

f(1)=7182818284? that isn't prime. there are so many factors of that number. will someone please just tell me what i am doing wrong? have i misunderstood the question? HELP!!!

7427466391 is not a prime number. it has lots of factors.....

I don't guess I understood the question. It didn't ask for the first 10 consecutive primes in digits of e. It asked for "First 10 digit prime in consecutive digits of e". so the f(1) should suffice, no? I don't know. That's just how i took it.... 7427466391? .... is it just the first prime number found in consecutive digits of e? i don't understand. too complicated for a highschooler i guess....

Im a student at Maggie l walker governor's school for government and international studies, and I heard about the site in my math class. I found the number and went to the site, but i think it's been shut down. No matter what computer I used, I still couldn't get on it. Any insights?

No, that's overkill. It's much simpler actually.
Sum of digits is the key.

i figured out the formula for the 2nd part.

f(1)=7.18E + 9
f(2)=8.18E + 9
f(3)=8.75E + 9
f(4)=7.43E + 9

so that is how they got but snice i just got that i havent figured that last one yet.

and that is how they got: f(1)=7182818284 and ect

just a suggestion but have you tried to use the functions as web addy and see where that takes you maybe a clue to a specific web number and that might be that code but i don't really know much

Hi I solved it and submitted my resume to google. It says they will post the answer within a few months to people who cannot solve it but by then you are SOL.

Nope, wrong number. And the account at linux.org still works. Probably sometimes it gets locked after 3 bad logins, but at least at the moment it works.

ken westberg, you are very close, but the answer is even simpler :)

540891499
it didnt work, i either made an error (probable)
or this is uncle bobs joke

the second part is like the first, use the numbers in series but this time a fibonacci series that equals 49 that appears after the answer.com series

Consecutive means one after the other.

I agree. The first part seems to be easily solved by a brute force algorithm. The second part is a different sort. As long as you can recognize the pattern and make an intuitive leap, it is a simple program to write to do what you need to do.

I think Google wanted to make it easy for the type of engineers they are looking for and hard for those that can't not think in non-linear fashions.

I like the fact that the used e as pretty much just an intimidation factor - or maybe a geek coolness factor.

Try summing the digits of each sequence and see what you get. This is way easier than I'd imagined it would be.

I figured out the second part, but when I go to Linux, it doesn't work, because I think the account has been frozen due to too many failed attempts. Does this seem to be a problem for anyone else.

Yeah, the same algorithm is used in .NET (in Hashtable impementation).

use that, and figure out which 10 digits from e are prime, feed the numbers, im not giving the answer just sparkin the fire...

/**************************************
** Program: prime.c **
** Date:9/27/99 **
** Last Revised: 10/1/99 **
** Programmer: Manuel F. Castillo **
** Purpose: prime.c defines the **
** function IsPrime, and calculat- **
** es wether n, the number given **
** by the user, is prime or not. **
**************************************/

#include


#include
/* math.h contains the square root and double functions */

#include "prime.h"
/* prime.h declares the function IsPrime */

int IsPrime (int n)
/* function IsPrime is defined. */

{
int i, limit;
/* variables i and limit are used in the for-loop */

if (n <= 1) return (0);
/* if n is less than or equal to 1, it is not prime */

if (n == 2) return (1);
/* if n is 2, the first prime number, IsPrime will return true */

if (n % 2 == 0) return (0);
/* if n divides evenly into 2 it is not a prime number */

limit = sqrt((double)n) + 1;
/* this makes n a double type number (ex: 1 = 1.00) and takes the square root */

for (i = 3;i<=limit;i+=2)
/* the for-loop runs until i is equal to the limit, which is defined above as the square root of the number (automatically truncated) and + 1 */
{
if (n % i == 0) return (0);
/* if the number is divisible by i, it is not a prime number. */
}

return (1);

}

Yeah, but it requires at least a bit of out-of-box thinking, while first part is easily solvable by a brute force.

Second part is even easier ;)

That was easy part, doable by brute force :)
What about the next one?

PS. NO SPOILERS PLEASE.

7427466391.com

Just start from the beginning of this huge number and find first 10 digits, which form a prime number.
Then go to xxxxxxxxxx.com site, where xxxxxxxxxx is that number.

OK
since i can't make heads or tails out of this other then It is a really large number. I am now sure that i have missed something. Must simply be over my head.
thank anyways
Alex

These are just digits of the e constant. You can find first 1000 of them at http://sources.wikipedia.org/wiki/E_to_10%2C000_places

Please define consecutive digits. I heard about this off of a website and the program seems real simple to write so I am thinking I missed something. Anyways I'm just doing this to see if I can.
Thanks
Alex

Leave a comment