[personal profile] nibot

So, Google currently has a little promotion that involves a sort of puzzle hunt. The first puzzle, published on billboards and at [livejournal.com profile] googleblogatom is to find the first 10-digit prime number to occur in consecutive digits of e.

I tried to solve it using only standard unix programs, with the following pipeline:

cat e.2mil | delay_line 10 | factor | awk '$1=$2":" {print($2)}'

That pops out the right answer immediately...

e.2mil is a text file containing the first 2 million digits of e, and delay_line is a little C program that takes a stream of characters and whenever it receives a character after the ninth character, it outputs the previous ten characters seen. It would be much more satisfying if delay_line were implemented as a clever script and perhaps if e.2mil were generated somehow instead of with Mathematica or a Google search. (I know that there are faster ways to check primality than explicitly computing factors, but obviously this is quick enough...)

Two fun exercises on the side: download GNU coreutils and look at the sourcecode to factor to see how it works (it uses 'Wheel Factorization'), and compute the expected position of the first 10-digit prime in a random sequence of digits.

The second puzzle is to find what comes next in this sequence: 7182818284, 8182845904, 8747135266, 7427466391, _____ .

Further notes will appear on [livejournal.com profile] nibot_lab.

Date: 2004-07-13 07:40 am (UTC)
From: [identity profile] eigenvalue.livejournal.com
Hmm, what's so interesting about primes in the digits of e? I don't see what Google is trying to do ...

Date: 2004-07-13 07:06 pm (UTC)
From: [identity profile] nibot.livejournal.com
Nothing really.. it's just a convenient source of pseudorandom digits. (-:

They're just posing some puzzles...

Date: 2004-07-13 07:35 pm (UTC)
From: [identity profile] eigenvalue.livejournal.com
Hmm, right.

In any case, I liked your solution method.

March 2020

S M T W T F S
1234567
891011121314
15 161718192021
22232425262728
293031    

Style Credit

Page generated Sep. 7th, 2025 08:48 pm
Powered by Dreamwidth Studios

Expand Cut Tags

No cut tags

Most Popular Tags