In July 2004, Google tried a innovative way of recruiting talented people, by posting a mathematical puzzle on a billboard on 'Highway 101' in the heart of silicon valley. The billboard read:

The answer, 7427466391.com, would lead to a Web page with yet another equation to solve, with still no sign of the firm that wanted to recruit some of the best math guys, out there. It wasn't known that it was Google, until the puzzle was cracked.

Here's a pic of that billbaord:

I got to know this puzzle much later and thought of giving it a try. Without thinking much, my first idea was to use a simple, naive, brute-force approach of calculating Euler's Number (e) to around 10000 digits and then loop over the decimal part of 'e', taking 10 digits in each step and incrementing by 1 digit, in each step. I tried it and it worked, without consuming much time.

"Euler's Number" can be calculated in a couple of ways, but I used the following formula:

With the above formula, we can calculate 'e' by looping through, finding factorial and adding up 1/Facorial(n), in each and every loop. Java was my programming language of choice, but calculating e to 10000 digits precision is a problem because you cant use the normal primitives like "double", "float" or whatever to contain the huge number of digits in the decimal part of a number. So, it was pretty obvious that I had to use 'BigDecimal'.

One more tricky part was to determine 'how many times should the program loop through , for the precision to be around 10000 digits'? I tried a couple of combinations and found that "100" would be good enough. Also it doesn't consume much time. If you try it for 10000 or more, it would probably take a couple of minutes or hours.

Ok....I looped through "100" times in the code, calculated 'e' to a bit more than 10000 digits, in the first step. The next step, I looped through the decimal part of 'e', taking 10 char substrings (starting from the decimal point) in each step and checking whether its a prime or not. If it's a prime, the Puzzle is solved!

Here's the Java code for finding the 'First 10 digit prime number in the consecutive digits of e':

I ran this program and got the following output:

So, thats the answer and the domain address would be

....and here's the "Euler's Number (e)" that I calculated using the above approach: 'e to 10000 digits'

PS: The above solution is a very basic, brute-force/trial-and-error approach that I used, but it very much solves the puzzle.

- GCJ 2014 - 'Deceitful War'
- GCJ 2014 - 'Cookie Clicker Alpha' Problem
- GCJ 2014 - Magic Trick
- GCJ 2013 - Fair And Square
- GCJ 2013 - Tic-Tac-Toe-Tomek
- GCJ 2012 - Recycled Numbers
- GCJ 2012 - Dancing With Googlers
- GCJ 2012 - Speaking In Tongues
- GCJ 2011 - Magicka
- GCJ 2011 - Bot Trust
- GCJ 2010 - Fair Warning
- GCJ 2010 - Snapper Chain
- Odd Man Out - GCJ 2010 (Africa)
- Store Credit - GCJ 2010 (Africa)
- T9Spelling - GCJ 2010 (Africa)
- Reverse Words - GCJ 2010 (Africa)
- All Your Base - GCJ 2009
- Alien Language - GCJ 2009
- Google Code Jam 2008 - Minimum Scalar Product
- GCJ 2008 - Alien Numbers
- Playing With Googol
- Google Billboard Puzzle
- Euler's Number (e) to 10000 digits
- Spiral Walking

- GCJ 2014 - 'Deceitful War'
- GCJ 2014 - 'Cookie Clicker Alpha' Problem
- GCJ 2014 - Magic Trick
- GCJ 2013 - Fair And Square
- GCJ 2013 - Tic-Tac-Toe-Tomek
- GCJ 2012 - Recycled Numbers
- GCJ 2012 - Dancing With Googlers
- GCJ 2012 - Speaking In Tongues
- GCJ 2011 - Magicka
- GCJ 2011 - Bot Trust
- GCJ 2010 - Fair Warning
- GCJ 2010 - Snapper Chain
- Odd Man Out - GCJ 2010 (Africa)
- Store Credit - GCJ 2010 (Africa)
- T9Spelling - GCJ 2010 (Africa)
- Reverse Words - GCJ 2010 (Africa)
- All Your Base - GCJ 2009
- Alien Language - GCJ 2009
- Google Code Jam 2008 - Minimum Scalar Product
- GCJ 2008 - Alien Numbers
- Playing With Googol
- Google Billboard Puzzle
- Euler's Number (e) to 10000 digits
- Spiral Walking

- Recursion Depth - Java
- RESTFul Web Service - Seam Component Injection
- Micro-benchmarking Java Code With Caliper
- JSF & Highcharts (Javascript Chart Library)
- Add 'Syntactic Sugar' With 'Fluent Interface'
- Priority Queue in Java
- Compile Java Files At Runtime
- Missing Number
- Guice - AOP (Aspect Oriented Programming)
- Creating Executable Jar File With Maven Shade Plugin
- Java - Looping Through A Range of BigInteger Values
- Create Your Own Dependency Injection Framework
- Google Guice - Example
- Guice Grapher - Example
- Using Richfaces 'Suggestion Box' As Combo Box
- Hashcode Of A String In Java
- Richfaces - Modal Panel As A Wizard
- Jasper Reports - Thermometer Report
- Jasper Reports - Gantt Chart
- Jasper Reports - Example
- Seam - Load i18n Messages From Database
- Autoboxing In Java & Bug Patterns
- Dont Smack The Stack (Deal With Stack Overflow Exceptions)

The views expressed on this blog are my personal views and do not reflect the views of
my employer or campaigns I am supporting.

All sample code is provided for illustrative purposes only. These examples have not been thoroughly tested under all conditions. The writer therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.

All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.

All sample code is provided for illustrative purposes only. These examples have not been thoroughly tested under all conditions. The writer therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.

All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.