Billboard Challenge, Part 1
June 22, 2012
Several years ago, a billboard with this text appeared in the tech centers of Silicon Valley and Route 128:
{ first 10-digit prime found in consecutive digits of e }.com
Your task is to write a program that finds the first 10-digit prime found in consecutive digits of e. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.
[…] today’s Programming Praxis exercise, our goal is to solve the problem posed to potential employees by a […]
My Haskell solution (see http://bonsaicode.wordpress.com/2012/06/22/programming-praxis-billboard-challenge-part-1/ for a version with comments):
Python solution
At first I didn’t check to make sure ‘number’ had 10 digits, and it found a ‘0’ followed by a 9-digit prime.
e_digits() and is_prime() come from previous exercises
[…] recent Programming Praxis problem resurrected the famous Google billboard puzzle. Back in July of 2004, Google put up billboards all over the country […]
I’m falling in love with Python. This takes a while to run because it doesn’t evaluate lazily, but that’s a consequence of my structure phobia.