Cayley problem 23, 1997

January 22, 2020

Given the set , how many integers cannot be written as the sum of exactly two different elements of ?

The numbers in are Fibonacci numbers, so we may guess that some magic is involved here. Indeed, we vaguely remember something about numbers having unique representations as sums of Fibonacci numbers. If the sum of any two Fibonacci numbers is a unique integer, the job of counting possibilities would be a lot simpler. Perhaps we can prove this. Here are the first 10 Fibonacci numbers:


1 2 3 4 5 6 7 8 9 10
1 1 2 3 5 8 13 21 34 55

Set contains to . Notice that is not included in . We want to prove that the sum of any two different Fibonacci numbers and with is unique.

Let . There are two situations to think about. First, if then

by definition of Fibonacci numbers. And if it is clear that

Either way, .

Suppose the same number can be written as the sum of two different Fibonacci numbers in two different ways:

There is no loss if we suppose and . Since , we have

And since , we have

Since is sandwiched between two consecutive Fibonacci numbers, it must be that and . For Fibonacci numbers greater than , these imply and .

Now we can count. Imagine all the possible sums of two elements of organized into a table. We remove the sums of the form : this amounts to removing the diagonal which has 9 element. Then we divide by two to remove one of the upper or lower triangles of the table, because we don’t want to count both and . This leaves

There are 36 integers expressible as the sum of two elements of . Smallest is 3, largest is 89. In the range there are numbers. The total number of integers not expressible is therefore 87 - 36 = 51.

Let’s check this by Racket programming.

First we create a list of all the numbers expressible as the sum of two different elements of . We use a nested for-loop with a when-clause to catch the cases we are interested in.

(define cayley-23-list (list 1 2 3 5 8 13 21 34 55))

(define expressibles
  (for*/list ((Fm cayley-23-list)
              (Fn cayley-23-list)
              #:when (> Fm Fn))
    (+ Fm Fn)))

And then we filter the range of numbers from 3 to 89, keeping only the ones that are not in the expressible list. Getting the length of this filtered range solves the problem.

(define (solve-cayley-23)
  (length
   (filter
    (lambda (n)
      (not (member n expressibles)))
    (range 3 90))))

Run it in the Racket interactive REPL

> (solve-cayley-23)
51

There we go!

Cayley problem 23, 1997 - January 22, 2020 - ted szylowiec