# Continuous function that contains all Fibonacci terms?

**URL:** <https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018>\
**Category:** Factual Questions\
**Created:** [March 27, 2009, 6:37pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018 "2009-03-27T18:37:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)\
**Post date:** [March 27, 2009, 6:37pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/1 "2009-03-27T18:37:39Z")

</div>

First, I know the Fibonacci sequence isn’t quite a function - it’s more like a binary operation, but it’s not really that either.

So I’m defining the function as

_f(x) = the xth term of the Fibonacci sequence_.

f(1) = 1  
f(2) = 1  
f(3) = 2  
f(4) = 3  
f(5) = 5  
etc.

I know that given any finite number of points you can develop a polynomial function that contains all those points, but is there a continuous function that contains every point of the Fibonacci sequence?

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [March 27, 2009, 6:41pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/2 "2009-03-27T18:41:46Z")

</div>

It has a known [closed form](http://en.wikipedia.org/wiki/Fibonacci_number#Closed_form_expression) that’s been known for some time.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [March 27, 2009, 8:24pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/3 "2009-03-27T20:24:33Z")

</div>

> [@bup](#):
>
> First, I know the Fibonacci sequence isn’t quite a function

It’s not the kind of thing we normally think of when we think of functions, but you can consider any sequence to be a function whose domain is the set of natural numbers.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [March 27, 2009, 9:07pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/4 "2009-03-27T21:07:39Z")

</div>

There are plenty of continuous functions that do what you want: For instance, you could just linearly interpolate between adjacent values. What you really want is a _smooth_ function (where smooth can be defined in a variety of ways, but usually means that the function and all of its derivatives are continuous).

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 27, 2009, 9:35pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/5 "2009-03-27T21:35:31Z")

</div>

**ftg** already pointed it out, but just to save you the clicking time, one smooth solution is given by Binet’s formula, f(n) = [phi^n - (1 - phi)^n]/sqrt(5), where phi = [1 + sqrt(5)]/2.

To derive this, consider the sequence of vectors given by V(n) = \<F(n), F(n+1)\>. Note that there is a fixed linear transformation M which sends V(n) to V(n+1) [namely, the one which sends \<a, b\> to \<b, a+b\>]; thus, V(n) = M^n \* V(0). If M has n linearly independent eigenvectors, then it can be [diagonalized](http://en.wikipedia.org/wiki/Diagonalizable_matrix), automatically yielding a closed formula for (the matrix representing) M^n, and thus for V(n), and thus for F(n); carrying this out is exactly what obtains Binet’s formula.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 27, 2009, 9:41pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/6 "2009-03-27T21:41:51Z")

</div>

(Oh, replace ‘F’ with ‘f’ as necessary above.)

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [March 27, 2009, 10:52pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/7 "2009-03-27T22:52:09Z")

</div>

By the way, if you have a continuous real valued function defined on a closed subset of the reals, you can always continuously extend it to all of the reals (this is a special case of Tietze’s extension theorem). Since (any subset of) the integers is closed, any sequence can be continuously extended to all of the reals.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [March 28, 2009, 1:48pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/8 "2009-03-28T13:48:58Z")

</div>

Indistinguishable’s formula is not quite right. Let g = (1 + sqrt(5))/2 (that’s the golden ratio) and h = (1 - sqrt(5))/2 (which I would usually call g-bar, the conjugate). Then f\_n = (g^n - h^n)/sqrt(5), so you could define f(x) = (g^x - h^x)/sqrt(5). Of course, there will be many many more continuous functions (for example, you could interpolate linearly between each value and the next, or put in any fanciful curve you like between any two successive values). Notice that since h^n alternates sign and rapidly converges to 0 and sqrt(5) \> 2, it follows that f\_n is the **nearest** integer to g^n/sqrt(5), but alternates being above and below that value.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 28, 2009, 5:23pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/9 "2009-03-28T17:23:11Z")

</div>

Wait, what’s wrong with my formula? h = 1 - g, making your formula the same as mine.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [March 28, 2009, 7:13pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/10 "2009-03-28T19:13:29Z")

</div>

> [@](#):
>
> By the way, if you have a continuous real valued function defined on a closed subset of the reals, you can always continuously extend it to all of the reals (this is a special case of Tietze’s extension theorem). Since (any subset of) the integers is closed, any sequence can be continuously extended to all of the reals.

That seems trivially easy to prove… Is there a corresponding theorem for smooth functions, or even for analytic ones?

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 28, 2009, 7:29pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/11 "2009-03-28T19:29:34Z")

</div>

Well, any sequence of reals, considered as a function of type N -\> R, extends to a smooth function of type R -\> R using infinitary linear combinations of [bump functions](http://en.wikipedia.org/wiki/Bump_function).

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 28, 2009, 7:35pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/12 "2009-03-28T19:35:14Z")

</div>

[I.e., just put a narrow bump of the right height around each natural number]

---

<div class="post-metadata">

**Author:** ![totoismomo](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@totoismomo](https://boards.straightdope.com/u/totoismomo)\
**Post date:** [March 29, 2009, 12:50am UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/13 "2009-03-29T00:50:05Z")

</div>

> [@Chronos](#):
>
> That seems trivially easy to prove… Is there a corresponding theorem for smooth functions, or even for analytic ones?

Yes, there is a corresponding theorem for smooth functions, which also holds for for any smooth manifold and not just Euclidean space. The idea behind the proof is that you rewrite your function as a sum of bump functions, like **Indistinguishable** did above.

But there is not analogous theorem for analytic functions (neither in the real-analytic or complex-analytic case). For instance, if A is any closed ball in the complex plane not containing the origin, f(z) = 1/z is analytic on A. But this function cannot be extended to a function g analytic on the whole complex plane, since g would have to have the same power series expansion as f about any point in A, which means that g would not be analytic at z = 0. A similar argument shows this example applies to the real-analytic case as well.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [March 29, 2009, 2:08pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/14 "2009-03-29T14:08:52Z")

</div>

> [@Indistinguishable](#):
>
> Wait, what’s wrong with my formula? h = 1 - g, making your formula the same as mine.

My apologies–I didn’t read your formula carefully enough and missed the second term.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [March 29, 2009, 2:14pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/15 "2009-03-29T14:14:56Z")

</div>

I am not sure what you mean by “smooth”, but it is true for infinitely differentiable functions, although not, as already observed, for analytic. The argument for infinitely differentiable makes use of translates of the function whose value for positive x is e^{-(1/x^2)} and which is 0 at 0 and for all negative x. This function is infinitely differentiable at 0 and can be used to interpolate between different slopes.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [March 29, 2009, 6:23pm UTC](https://boards.straightdope.com/t/continuous-function-that-contains-all-fibonacci-terms/491018/16 "2009-03-29T18:23:09Z")

</div>

> [@](#):
>
> I am not sure what you mean by “smooth”, but it is true for infinitely differentiable functions, although not, as already observed, for analytic. The argument for infinitely differentiable makes use of translates of the function whose value for positive x is e^{-(1/x^2)} and which is 0 at 0 and for all negative x. This function is infinitely differentiable at 0 and can be used to interpolate between different slopes.

Yeah, I should have thought of that… That’s one of my favorite functions.
