## Billboard Challenge, Part 2

### June 26, 2012

In the previous exercise, we looked at a programming challenge that involved the digits of *e*. Solving that exercise and clicking on the indicated web site took the solver to this page:

`Congratulations. You've made it to level 2. Go to http://www.Linux.org and enter Bobsyouruncle as the login and the answer to this equation as the password.`

```
```

`f(1)= 7182818284`

f(2)= 8182845904

f(3)= 8747135266

f(4)= 7427466391

f(5)= __________

Don’t try to login; the account no longer exists.

Your task is to write a program to find the next number in the sequence. 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.

Pages: 1 2

[...] today’s Programming Praxis challenge, our goal is to solve the second part of the billboard test, which is [...]

My Haskell solution (see http://bonsaicode.wordpress.com/2012/06/26/programming-praxis-billboard-challenge-part-2/ for a version with comments):

The difficulty with these kinds of problems is that the given terms often do not identify a unique sequence.

For example, I determined that the values for f(1), f(2), f(3), and f(4) start at position 2, 6, 24, and 100, respectively, in the digits of e. After a few minutes at OEIS.org, I discovered that the differences between successive indices–2, 4, 18, 76–correspond to the first few even Lucas numbers. So I whipped up the following Python code to calculate f(5):

Which results in the following output:

f(1) = 7182818284

f(2) = 8182845904

f(3) = 8747135266

f(4) = 7427466391

f(5) = 4637721112

If you’ve looked at the Praxis solution, this is not the answer they were looking for.

Mike: Yes, that’s a problem.

My solution also differs from the suggested solution at A095926, because I require all numbers to be ten digits long, as in the first challenge problem, but the OEIS solution permits leading zero.