# Number sequences - from discrete to continuous

**URL:** <https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266>\
**Category:** Factual Questions\
**Created:** [January 16, 2001, 3:09am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266 "2001-01-16T03:09:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [January 16, 2001, 3:09am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/1 "2001-01-16T03:09:40Z")

</div>

Is there a way of naturally interpolating for certain sequences such that not just integers, but any real number can be in the domain, eg.

If you plot (x,y) where x=1,2,3,… and y=Fib[sub]n[/sub] (the nth Fibonacci number) you’d get the points (0,0), (1,1), (2,1), (3,2), (4,3), (5,5), (6,8), etc. Is there a way to make this point-wise curve continuous so that it’s defined for, say, x=3.5 and still has the flavour of the Fibonacci sequence.

If you plot (x,y) where y=x! you’d get the points (0,1), (1,1), (2,2), (3,6), (4,24), (5,120), etc. Is there a way to make this point-wise curve continuous, say for x = 3.5 and still retain the sense of x!

---

<div class="post-metadata">

**Author:** ![Orbifold](https://avatars.discourse-cdn.com/v4/letter/o/779978/32.png) [@Orbifold](https://boards.straightdope.com/u/Orbifold)\
**Post date:** [January 16, 2001, 3:46am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/2 "2001-01-16T03:46:02Z")

</div>

In general the answer depends on the sequence. (Not to mention what you mean by the “flavour” or “sense” of the sequence.) But in both of your two examples there is a nice way to extend the sequence to the real numbers.

For the Fibonacci numbers use the fact that there’s a general formula, namely

```auto

Fib[sub]n[/sub] = (r[sub]1[/sub])[sup]n[/sup]/sqrt(5) - (r[sub]2[/sub])[sup]n[/sup]/sqrt(5)

```

where r[sub]1[/sub]=(1+sqrt(5))/2 and r[sub]2[/sub]=(1-sqrt(5))/2. This formula extends to all the real numbers, and still preserves the property that Fib[sub]n+2[/sub]=Fib[sub]n+1[/sub]+Fib[sub]n[/sub]. There are similar formulas for other sequences defined by recursive formulas like the Fibonacci relation.

Extending factorials is a lot harder, but still possible. There’s a function called the Gamma function which is defined for every real number except 0 and the negative integers, and which has the properties that Gamma(x)=(x-1)! for every positive integer x, and Gamma(x+1)=x\*Gamma(x). You can use this to extend factorials to real numbers while still preserving the property that (x+1)!=(x+1)\*x!. I’m not certain of the definition off the top of my head, but I _think_ it’s:

```auto

Gamma(x)=int(t[sup]x-1[/sup]e[sup]-t[/sup],t=0..infinity)

```

where int(…,t) denotes integration with respect to t. (I’ll double-check that tomorrow when I have access to the textbooks in my office.)

Extending factorials to non-integers is especially interesting: you get suprising results like (-1/2)!=sqrt(pi).

---

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [January 16, 2001, 4:09am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/3 "2001-01-16T04:09:42Z")

</div>

**Math Geek** : Thank you. Excellent and helpful response.

I’m still digesting the gamma function. This may be obvious to you, but is Gamma(x) differentiable everywhere (other than at x=0)?

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 16, 2001, 4:39am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/4 "2001-01-16T04:39:25Z")

</div>

Wow…a post by the great Karl Guass?! We are honored! 🙂

Hope you don’t consider this a hijack, but many years ago (when I was supposed to be studying something totally different for a math degree) I got curious about fractional differentials.

e.g. y = x ^ 3  
dy/dx = 3x ^ 2  
d2y/dx2 = 6x  
d3y/dx3 = 6

What meaning to assign to

d(1/2)y/dx(1/2) ?!

I started playing around with it for a while, and came up with a general formula for d(n)y/dx(n) (not difficult - just follow the pattern). Ends up with one or two factorials - can’t remember exactly.

I then thought, whatever the general form for non-integers, it has to reduce to the integer version in simple cases. I ended up with some functional equation (i.e. “find the function which satisfies the following”) which I couldn’t solve - I didn’t have the math to do it. (Or maybe had slept through the appropriate lecture.) I vaguely remembered something about a gamma function for generalizing factorials to non-counting numbers, but couldn’t remember the details. (Hey - this was when the Internet was still a bunch of wires and green screens!)

Anyway - when I finally did research it, I was flattered to find that none other than the great Leibnitz had adopted almost _exactly_ the same approach - except he was talented enough to take it to a conclusion. I believe his formula for d(1/2)y/dx(1/2) was pretty complicated, invovling a bunch of sines, cosines and exponentials. It didn’t indeed reduce to the simple case for integers (via identities like sin2x + cos2x = 1 etc.)

Anyone else know anything about these? Are there any practical applications? What about trying to imagine what something like d(1/2)x/dy(1/2) represents, geometrically? A web search didn’t turn up much (even wonderful Google.)

---

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [January 16, 2001, 4:56am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/5 "2001-01-16T04:56:44Z")

</div>

> [@](#):
>
> \*Originally posted by DarrenS \*  
> \*\*Wow…a post by the great Karl Guass?! 🙂
> 
> \*\*

I am offended that you had to ‘guass’ at the spelling of my name:D

> [@](#):
>
> \*\*  
> Anyone else know anything about these? Are there any practical applications? What about trying to imagine what something like d(1/2)x/dy(1/2) represents, geometrically?
> 
> \*\*

Very interesting. Not at all a hijack. It is _exactly_ in the spirit of my OP.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [January 16, 2001, 6:56am UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/6 "2001-01-16T06:56:07Z")

</div>

MathGeek, I get 2.40975 + 0.0829962 I for Fib(3.5)

---

<div class="post-metadata">

**Author:** ![John\_Kentzel-Griffin](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@John\_Kentzel-Griffin](https://boards.straightdope.com/u/John_Kentzel-Griffin)\
**Post date:** [January 16, 2001, 4:06pm UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/7 "2001-01-16T16:06:22Z")

</div>

Fractals (some…all?) have non-integer dimensionality.

If you divide an n-dimensional figure into a number “little” pieces, the number of pieces within a distance r from some point is proportional to r [sup]n[/sup]. For fractals, it turns out that n can be non-integral.

---

<div class="post-metadata">

**Author:** ![Orbifold](https://avatars.discourse-cdn.com/v4/letter/o/779978/32.png) [@Orbifold](https://boards.straightdope.com/u/Orbifold)\
**Post date:** [January 16, 2001, 5:34pm UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/8 "2001-01-16T17:34:29Z")

</div>

> [@](#):
>
> \*Originally posted by KarlGauss \*  
> \*\*I’m still digesting the gamma function. This may be obvious to you, but is Gamma(x) differentiable everywhere (other than at x=0)? \*\*

It is, but I wouldn’t call it obvious by any means. You have to differentiate under the integral sign, which isn’t always possible when you have an indefinite integral like this one (that is, an integral over an infinite domain). It just happens to work in this case.

> [@](#):
>
> \*Originally posted by RM Mentock \*  
> \*\*Math Geek, I get 2.40975 + 0.0829962 I for Fib(3.5) \*\*

Whoops! You’re absolutely right. I forgot that r[sub]2[/sub] is negative, and you can’t just raise negative numbers to arbitrary powers without getting complex numbers as a result. Extending Fibonacci numbers to the real line may be trickier than I thought; I’ll have to think about that some more…

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [January 16, 2001, 5:58pm UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/9 "2001-01-16T17:58:38Z")

</div>

> [@](#):
>
> \*Originally posted by Math Geek \*
> 
> > [@](#):
> >
> > \*Originally posted by KarlGauss \*  
> > \*\*I’m still digesting the gamma function. This may be obvious to you, but is Gamma(x) differentiable everywhere (other than at x=0)? \*\*
> 
> It is, but I wouldn’t call it obvious by any means.

The gamma function has poles at all negative integers, so it isn’t differentiable at those points either. other than that, it’s OK.

---

<div class="post-metadata">

**Author:** ![MilTan](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@MilTan](https://boards.straightdope.com/u/MilTan)\
**Post date:** [January 16, 2001, 7:22pm UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/10 "2001-01-16T19:22:51Z")

</div>

I think that the fibonacci sequence is very easy to generate for arbitrary powers. Although it does not follow for the first few (you get within a few percent once n = 3) numbers, the following formula will do an adequate job of producing Fibonacci numbers:

F(n) = (phi^n)/sqrt(5)

where

phi = (1 + sqrt(5))/2

* * *

Math Geek, your formula is essentially correct, as the two R’s that you gave are the two roots you get when you solve the Fibonacci difference equation. However, similar to solving differential equations, the difference equation solution is actually:

C1\*(R1^n) + C2\*(R2^n)

Where R1 is phi, and R2 is the same, with a - instead of a +.

C1 winds up being 1/sqrt(5). And, I must confess that its been a while since I did difference equations, so I forget what happens to C2. All I know is that if C2 is zero, you get correct answers for F(n). It is accurate beyond my calculators range of precision at n = 12.

* * *

As a further note, phi is the golden mean, or approximately 1.618

---

<div class="post-metadata">

**Author:** ![Orbifold](https://avatars.discourse-cdn.com/v4/letter/o/779978/32.png) [@Orbifold](https://boards.straightdope.com/u/Orbifold)\
**Post date:** [January 16, 2001, 10:25pm UTC](https://boards.straightdope.com/t/number-sequences-from-discrete-to-continuous/50266/11 "2001-01-16T22:25:20Z")

</div>

> [@](#):
>
> \*Originally posted by MilTan \*  
> \*\*Math Geek, your formula is essentially correct, as the two R’s that you gave are the two roots you get when you solve the Fibonacci difference equation. However, similar to solving differential equations, the difference equation solution is actually:
> 
> C1\*(R1^n) + C2\*(R2^n)
> 
> Where R1 is phi, and R2 is the same, with a - instead of a +.
> 
> C1 winds up being 1/sqrt(5). And, I must confess that its been a while since I did difference equations, so I forget what happens to C2. All I know is that if C2 is zero, you get correct answers for F(n). It is accurate beyond my calculators range of precision at n = 12.  
> \*\*

C1 and C2 are determined by the initial conditions. In **KarlGauss** ’s original post, he specified the initial conditions Fib[sub]0[/sub]=0 and Fib[sub]1[/sub]=1. If you substitute n=0 and n=1 into the general solution, you get C1+C2=0 and C1_R1+C2_R2=1, which together imply that C1=1/sqrt(5) and C2=-1/sqrt(5). That’s where I got the general formula that I quoted. (“Essentially” correct indeed 🙂 )

It’s true that if you set C2=0 instead, you get a formula which is accurate _to the nearest integer_. This is because |R2|\<1, and hence the term C2\*R2[sup]n[/sup] will contribute less and less to the formula as n tends to infinity. So the function F(x)=(R1[sup]x)[/sup]/sqrt(5) is well-defined (avoiding the problems with taking powers of a negative number that **RM Mentock** noticed) and has the property that F(x+2)=F(x+1)+F(x) for all x. But F(n) will only _approximately_ equal Fib[sub]n[/sub] when n is an integer. This may or may not be satisfactory, depending on your point of view.
