?

Log in

No account? Create an account

This · is · Not · a · Brain · Surgery


first 10-digit prime found in consecutive digits of e

Recent Entries · Archive · Friends · Profile

* * *
Recently riding my motorcycle on highway 101, south of San Francisco I've noticed big advertisement poster:

first 10-digit prime found in consecutive digits of e

(I stole the picture from some later post in spanish who also found the number. When I worked on this, google search did not find any results for this puzzle).

Out of curiosity I decided to find out what it is. Since I am still learning Haskell, I decided that that would be nice Haskell exercise. It was nice exercise indeed, in course of which I have learned more about Haskell and things like Rabin-Miller Probable Prime Test and Spigot Algorithm

Well, I did it and was able to find number. I went to the site, expecting something exiting, but it just says "Congratulations. You've made it to level 2" and offers next puzzle. Frankly, without knowing what it is about (I guess this is a new way to screen employees) I am not very inclined to spend more time solving their puzzles. Also, the next puzzle they offer is of kind I detest: trying to find next number in sequence. I hate when people ask something like this on interviews.

So, being dissapointed for being sent to wild goose chanse without any gratification, I decided to share the answer to their first problem. I hope search engines pick up this page soon and they will have more potential candidates knocking on the door of their second level.

The prime they were asking for is 7427466391.


I will apprecite if somebody who will get through all their puzzles will tell me what it was about.

UPDATE (September 2004): I would like to thank all of you who took their time to let me know that this is Google recruitment campaign. After solving second part of the puzzle I was able to see that for myself. So if you are looking for the answers: your got them right here. You are welcome to read the rest of my blog (or even subscribe to new posts with RSS).
Current Mood:
accomplished
* * *
* * *
[User Picture]
On July 10th, 2004 07:45 am (UTC), bird_owl commented:
All I can say these numbers are sequences of digits of E.
You can check it there --
http://home.istar.ca/~lyster/pistats/e1megresults.txt
[User Picture]
On July 10th, 2004 07:59 am (UTC), bird_owl replied:
offsets --

f(1) = 0
f(2) = 4
f(3) = 22
f(4) = 98

[User Picture]
On July 10th, 2004 09:12 am (UTC), notbrainsurgery replied:
Sequence of offsets could be found here:

http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A007901

But I am not sure if this means anything

[User Picture]
On July 10th, 2004 07:27 pm (UTC), bird_owl replied:
The answer must be 1510865746
But it seems not working. BTW, Linux.org blocking account after three login failures. That's pretty stupid to use this accound for such purpose.
On July 26th, 2004 01:37 am (UTC), (Anonymous) replied:
and how might you have come to such a brilliant conclusion??
On August 14th, 2004 08:51 am (UTC), (Anonymous) replied:
Accually the answer is...
The real answer is 5966290435.

And it's not really a great honor to be eligible to place your resume in with google any how.

This puzzle took me a grand total of 20 minutes. It doesn't mean I'm going to apply to work for some high and mighty search engine that thinks they have a HARD puzzle for people to solve. Shame on them for messing up traffic!
On August 26th, 2004 11:36 pm (UTC), (Anonymous) replied:
Re: Accually the answer is...
there is no possible way you solved this puzzle in 20 minutes. Show me the code you used to solve it. I would like to see it. Anyone who claims to have solved such a puzzle should then surely be able to show their code and explain how it works.
On August 31st, 2004 07:00 pm (UTC), supersaucy replied:
Re: Accually the answer is...
It's not a really difficult program, especially if you snag the digits of e off of a web page. Once you have the program written for the first part, the additions for the second part are trivial. I can easily believe that he did it in 20 minutes. Here's my program, which includes a couple of dead end ideas (I had an idea that it would have something to do with the factorization of the numbers, and another that actually makes a consistent series but doesn't work as the password):

#include 
[Error: Irreparable invalid markup ('<math.h>') in entry. Owner must fix manually. Raw contents below.]

It's not a really difficult program, especially if you snag the digits of e off of a web page. Once you have the program written for the first part, the additions for the second part are trivial. I can easily believe that he did it in 20 minutes. Here's my program, which includes a couple of dead end ideas (I had an idea that it would have something to do with the factorization of the numbers, and another that actually makes a consistent series but doesn't work as the password):

<pre>
#include <math.h>
#include <stdio.h>

long TestPrime(int *primes,int n,long test){
int bail;
long fail;
int i;
long sqrttest=ceil(sqrt(test));

for(i=0,bail=0,fail=0;i<n && bail==0;i++){
if((test%primes[i])==0){
bail=fail=primes[i];
}else if(primes[i]>sqrttest){
bail=1;
}
}
return(fail);
}

int main(){
int bail;
char e[]="27182818284590...<lots more digits>";
int elen;
long fail;
int i;
int j;
int n;
int primes[50000];
int sqrti;
int sum;
long test;

/*
printf("sizeof(int) = %u\n",sizeof(int));
printf("sizeof(long) = %u\n",sizeof(long));
printf("sizeof(long long) = %u\n",sizeof(long long));
printf("sizeof(double) = %u\n",sizeof(double));
printf("sizeof(long double) = %u\n",sizeof(long double));
*/

primes[0]=2;
n=1;
for(i=3;i<100000;i+=2){
sqrti=ceil(sqrt(i));
for(j=0,bail=0,fail=0;j<n && bail==0;j++){
if((i%primes[j])==0){
bail=fail=1;
}else if(primes[j]>sqrti){
bail=1;
}
}
if(fail==0){
primes[n]=i;
n++;
// printf("%d\n",i);
}
}

elen=strlen(e);
for(i=0;i<(elen-9);i++){
sum=test=0;
for(j=0;j<10;j++){
test+=(e[i+j]-48)*pow(10,9-j);
sum+=e[i+j]-48;
}
printf("%5d %010Ld",i,test);
for(j=0;test>1;j++){
fail=TestPrime(primes,n,test);
if(!fail){
if(j==0) printf(" PRIME");
else printf(" %Ld",test);
test=1;
}else{
printf(" %Ld",fail);
test/=fail;
}
}
if(sum==49) printf(" 49er!");
printf("\n");
}
}
</pre>
On September 16th, 2004 09:13 pm (UTC), (Anonymous) replied:
Re: Accually the answer is...
I found the answer in about 3 minutes, by entering the phrase 'first 10-digit prime found in consecutive digits of e' in Google and finding this web page.

PHPPPPPTTTT!!!!!!
On September 16th, 2004 04:21 pm (UTC), (Anonymous) replied:
Re: Accually the answer is...
5966290435 = 5 * 1193258087

Jesus, man. All numbers ending in 5 or 0 are divisible by 5.

Oh, and my point is, they are NOT PRIME.
On September 17th, 2004 10:55 am (UTC), (Anonymous) replied:
Re: Accually the answer is...
That's not supposed to be the prime number, it's the f(5) solution to the 2nd part of the problem.
On September 19th, 2004 03:44 am (UTC), (Anonymous) replied:
Re: Accually the answer is...
just wanna know how you found the 5966290435 in the 2nd part???
is it a solution like this Ax^3+Bx^2+Cx+D then you use the 4 points given and came out with a system of 4x4???
On August 11th, 2007 01:33 am (UTC), (Anonymous) replied:
Re: Accually the answer is...
I find it quite amusing that the person who blurted out "the answer is..." spelled "Actually" wrong. heh.
On September 16th, 2004 04:22 pm (UTC), (Anonymous) replied:
1510865746 is an even number (NOT PRIME). Apparently your prime number sieve never got to 2!
On December 23rd, 2007 12:03 am (UTC), (Anonymous) replied:
this was a google bilboard...used as a job promo...the first 10 people to go to the website were given job offers at google, which is times magazines PLACE TO WORK!!
* * *

Previous Entry · Leave a comment · Share · Next Entry