GOOGLE RECRUITING [UPDATED]

Technical — acosta @ 1:38 pm

Google is currently putting up billboards that read:

{first 10-digit prime found in consecutive digits of e}.com

Luckily for us, this is a ridiculously simple problem to solve. Assuming Net::DNS (or libnet-dns-perl),

#!/usr/bin/perl
use Net::DNS;
my $resolver = Net::DNS::Resolver->new;
my $e = '27182818284590452353602'
.'874713526624977572470936999595'
.'749669676277240766303535475945'
.'713821785251664274274663919320'
.'030599218174135966290435729003'
.'342952605956307381323286279434'
.'907632338298807531952510190115'
.'738341879307021540891499348841'
.'67509244761460668';
foreach (0 .. length $e) {
  my $n = substr $e, $_, 10
  my $q = $resolver->search("$n.com");
    if ($q) {
      print $n, "n";
    last;
    }
}

The answer? 7427466391.com. I’ll let you all solve the second problem on your own (which is equally simple).

UPDATE: This solution was posted on Slashdot an hour or so after I found it. If you know Mathematica well, check this out:

en = N[[ExponentialE], 1000];
Table[x = (Floor[en*(10^k)*10^10] -
  Floor[en*(10^k)]*10^10);
If[PrimeQ[x], {k, x}, {k, 0}], {k, 0, 100}]

4 Comments »

  1. Very nice work. You gonna work for google now?

    -Andy

    Comment by /\|=|5(|-|3|2 — 9/16/2004 @ 3:31 pm
  2. I was a little miffed my solution for the second problem was rejected.
    f(1) is the 10 digit string starting from the 2nd digit in e
    f(2) the 6th place
    f(3) the 24th place
    f(4) the 100th place

    Now if this were a true function, we would look for the recursive formula for the sequence 2,6,24,100
    Which happens to be f(1)=2, f(k+1)=f(k)*(k+2)
    So f(4+1) = 100 * (4+2) = 600.

    The sequence of 10 digits starting from position 600 is
    1730123819

    But that wasn’t the answer.
    Perhaps this is why I had a C average in college mathematics.

    Comment by sloppy — 9/17/2004 @ 10:33 am
  3. yes i realize my solution is a round-about way to get the answer, and yes i realize that it’s not mathematically rigorous to say the least, but hey … i got it.

    Comment by acosta — 9/17/2004 @ 12:54 pm
  4. yea that’s totally correct sloppy. i don’t know why it isnt workin … but hey, if you’re interested, the page you get to is here. Someone also solved it relatively easiliy, although through a foreign method (to me, at least), on Slashdot.

    Comment by acosta — 9/17/2004 @ 7:26 pm

RSS feed for comments on this post.

Leave a comment

vdov.net is an anthony costa production. ownership of the content provided is retained by the author and by vdov.net.