• Language
  • Navigation

Fibonacci Cipher

You're surfing the series of tubes during lecture one day and come across a blog post claiming to have the inside scoop on Ted Stevens' bank account. The blogger is a disgruntled ex-IT support engineer of Stevens' who claims that the PIN number on his checking account is a Fibonacci number that spells out a word, if 1 = a, 2 = b, ... 26 = z. For example, 89 is a Fibonacci number that spells "hi" (h= 8 and I = 9) using the specified mapping. He also mentions that Steven’s Fibonacci PIN spells the longest such word that can be created under this encoding.

A subsequent, even more disgruntled post goes on to reveal that the account number itself is a Fibonacci number that spells out the longest word possible when using a different encoding. However, in an ironic twist of fate, the blogger's second post gets tangled up in the series of tubes before he can divulge the encoding between numbers and letters.

Can you figure out:

  1. Stevens' PIN number and the corresponding word
  2. His account number and the corresponding word

Write some code (Java 1.5.0.16, GNU C/C++ 4.2.4, C# 2.0, Python 2.5.2, or Perl 5.8.8) that finds the longest word that can be spelled using a Fibonacci number, using the above criteria. Please submit:

  1. The longest word that can be spelled from a Fibonacci number using
    a = 1, b = 2 ... z = 26
  2. The longest word that can be spelled from a Fibonacci number using
    any 1-to-1 mapping between 0-25 and a-z , along with the corresponding
    Fibonacci number and encoding
  3. Any code used to find the answers to (1) and (2)

Solve the puzzle now by submitting your answer here!