• Keine Ergebnisse gefunden

A few recursively defined sequences

2. A closer look at induction

2.3. A few recursively defined sequences

2.3.1. an = aqn1+r

We next proceed to give some more examples of proofs by induction.

Example 2.23. Let(a0,a1,a2, . . .)be a sequence of integers defined recursively by a0=0, and

an = a2n1+1 for each n≥1.

(“Defined recursively” means that we aren’t defining each entry an of our se-quence by an explicit formula, but rather defining an in terms of the previous entries a0,a1, . . . ,an1. Thus, in order to compute some entry an of our sequence, we need to compute all the previous entries a0,a1, . . . ,an1. This means that if we want to compute an, we should first computea0, then computea1 (using our value ofa0), then compute a2(using our values ofa0 and a1), and so on, until we reach an. For example, in order to computea6, we proceed as follows:

a0 =0;

a1 =a20+1=02+1=1;

a2 =a21+1=12+1=2;

a3 =a22+1=22+1=5;

a4 =a23+1=52+1=26;

a5 =a24+1=262+1=677;

a6 =a25+1=6772+1=458 330.

And similarly we can compute an for any n ∈N.)

This sequence(a0,a1,a2, . . .)is not unknown: It is the sequence A003095 in the Online Encyclopedia of Integer Sequences.

44This computation relied on the principle of substitutivity for congruences. Here is how to rewrite this argument in a more explicit way (without using this principle): We haveambmmodnand abmodn. Hence, Proposition 2.21(c)(applied toam,bm,aandbinstead ofa,b,candd) yields amabmbmodn. This rewrites asam+1bm+1modn(sinceam+1=amaandbm+1=bmb).

A look at the first few entries of the sequence makes us realize that botha2and a3 divide a6, just as the integers 2 and 3 themselves divide 6. This suggests that we might have au | av wheneveruand v are two nonnegative integers satisfying u| v. We shall soon prove this observation (which was found by Michael Somos in 2013) in greater generality.

Theorem 2.24. Fix some q ∈ Nand r ∈ Z. Let (a0,a1,a2, . . .) be a sequence of integers defined recursively by

a0 =0, and

an =aqn1+r for eachn≥1.

(Note that if q = 2 and r = 1, then this sequence (a0,a1,a2, . . .) is precisely the sequence(a0,a1,a2, . . .)from Example 2.23. Ifq =3 andr =1, then our sequence (a0,a1,a2, . . .) is the sequence A135361 in the Online Encyclopedia of Integer Sequences. Ifq =0, then our sequence(a0,a1,a2, . . .)is (0,r+1,r+1,r+1, . . .). If q = 1, then our sequence (a0,a1,a2, . . .) is (0,r, 2r, 3r, 4r, . . .), as can be easily proven by induction.)

(a)For any k ∈Nand nN, we have ak+nakmodan. (b)For any n ∈Nand w∈ N, we have an | anw.

(c)If uand vare two nonnegative integers satisfying u| v, then au | av. Proof of Theorem 2.24. (a)Let n ∈N. We claim that

ak+n ≡ akmodan for everyk ∈N. (57) We shall prove (57) by induction onk:

Induction base: Proposition 2.14 (applied to an instead ofn) yields an ≡0 modan. This rewrites as an ≡ a0modan (since a0 = 0). In other words, a0+n ≡ a0modan

(since 0+n=n). In other words, (57) holds fork =0. This completes the induction base.

Induction step: Letm ∈N. Assume that (57) holds fork =m. We must prove that (57) holds fork =m+1.

We have assumed that (57) holds fork =m. In other words, we have am+n ≡ ammodan.

Hence, Proposition 2.22 (applied to am+n, am, an and q instead of a, b, n and k) shows thataqm+n ≡ aqmmodan. Hence, aqm+n +r ≡ aqm+rmodan. (Indeed, this fol-lows by adding the congruence aqm+n ≡aqmmodan to the congruencer ≡rmodan; the latter congruence is a consequence of Proposition 2.12(a).)

Now, (m+1) +n = (m+n) +1 ≥ 1. Hence, the recursive definition of the sequence(a0,a1,a2, . . .) yields

a(m+1)+n =aq((m+1)+n)−1+r= aqm+n+r

(since((m+1) +n)−1=m+n). Also, m+1 ≥1. Hence, the recursive definition of the sequence(a0,a1,a2, . . .) yields

am+1 =aq(m+1)−1+r=aqm+r.

The congruence aqm+n +r ≡ aqm +rmodan rewrites as a(m+1)+n ≡ am+1modan

(since a(m+1)+n = aqm+n +r and am+1 = aqm +r). In other words, (57) holds for k =m+1. This completes the induction step. Thus, (57) is proven by induction.

Therefore, Theorem 2.24(a) is proven.

(b)Let n∈ N. We claim that

an | anw for everyw∈ N. (58)

We shall prove (58) by induction onw:

Induction base: We have an·0 = a0 =0. But an |0 (since 0 =0an). This rewrites as an | an·0 (since an·0 = 0). In other words, (58) holds forw =0. This completes the induction base.

Induction step: Let m ∈ N. Assume that (58) holds for w = m. We must prove that (58) holds for w=m+1.

We have assumed that (58) holds forw =m. In other words, we have an | anm. Proposition 2.11 (a) (applied to anm and an instead of a and n) shows that we have anm ≡0 modan if and only if an | anm. Hence, we have anm ≡0 modan (since an | anm).

Theorem 2.24(a)(applied to k=nm) yieldsanm+n ≡anmmodan. Thus, anm+n ≡ anm ≡0 modan. This is a chain of congruences; hence, an application of Proposition 2.16 shows thatanm+n ≡0 modan. (In the future, we shall no longer explicitly say things like this; we shall leave it to the reader to apply Proposition 2.16 to any chain of congruences that we write down.)

Proposition 2.11 (a) (applied to anm+n and an instead of a and n) shows that we have anm+n ≡ 0 modan if and only if an | anm+n. Hence, we have an | anm+n (since anm+n ≡ 0 modan). In view of nm+n =n(m+1), this rewrites as an | an(m+1). In other words, (58) holds for w = m+1. This completes the induction step. Thus, (58) is proven by induction.

Therefore, Theorem 2.24(b) is proven.

(c)Let u and vbe two nonnegative integers satisfying u | v. We must prove that au | av. If v =0, then this is obvious (because if v=0, then av =a0=0 =0au and therefore au | av). Hence, for the rest of this proof, we can WLOG assume that we don’t havev =0. Assume this.

Thus, we don’t havev=0. Hence,v 6=0, so that v>0 (sincev is nonnegative).

Butu divides v (since u | v). In other words, there exists an integer w such that v =uw. Consider thisw. If we had w<0, then we would have uw ≤ 0 (sinceu is nonnegative), which would contradictuw =v >0. Hence, we cannot have w <0.

Thus, we must have w ≥ 0. Therefore, w ∈ N. Hence, Theorem 2.24 (b)(applied to n = u) yields au | auw. In view of v = uw, this rewrites as au | av. This proves Theorem 2.24(c).

Applying Theorem 2.24 (c)to q = 2 and r = 1, we obtain the observation about divisibility made in Example 2.23.

2.3.2. The Fibonacci sequence and a generalization

Another example of a recursively defined sequence is the famous Fibonacci se-quence:

Example 2.25. The Fibonacci sequence is the sequence (f0, f1, f2, . . .) of integers which is defined recursively by

f0 =0, f1 =1, and fn = fn1+ fn2 for all n≥2.

Let us compute its first few entries:

f0 =0;

f1 =1;

f2 = f1

|{z}

=1

+ f0

|{z}

=0

=1+0=1;

f3 = f2

|{z}=1

+ f1

|{z}=1

=1+1=2;

f4 = f3

|{z}

=2

+ f2

|{z}

=1

=2+1=3;

f5 = f4

|{z}

=3

+ f3

|{z}

=2

=3+2=5;

f6 = f5

|{z}=5

+ f4

|{z}=3

=5+3=8.

Again, we observe (as in Example 2.23) that f2 | f6 and f3 | f6, which suggests that we might have fu | fv whenever u and v are two nonnegative integers satisfying u| v.

Some further experimentation may suggest that the equality fn+m+1= fnfm+ fn+1fm+1 holds for alln∈ Nand m∈ N.

Both of these conjectures will be shown in the following theorem, in greater generality.

Theorem 2.26. Fix some a ∈ Z and b ∈ Z. Let (x0,x1,x2, . . .) be a sequence of integers defined recursively by

x0 =0, x1 =1, and

xn =axn1+bxn2 for eachn ≥2.

(Note that if a =1 and b = 1, then this sequence(x0,x1,x2, . . .) is precisely the Fibonacci sequence(f0, f1, f2, . . .)from Example 2.25. Ifa=0 andb=1, then our sequence (x0,x1,x2, . . .) is the sequence 0, 1, 0,b, 0,b2, 0,b3, . . .

that alternates between 0’s and powers of b. The reader can easily work out further examples.)

(a)We have xn+m+1 =bxnxm +xn+1xm+1for all n ∈Nand m∈ N.

(b)For any n ∈Nand w∈ N, we have xn | xnw.

(c)If uand vare two nonnegative integers satisfying u| v, then xu | xv. Before we prove this theorem, let us discuss hownotto prove it:

Remark 2.27. The proof of Theorem 2.26 (a) below illustrates an important as-pect of induction proofs: Namely, when devising an induction proof, we often have not only a choice of what variable to induct on (e.g., we could try proving Theorem 2.26 (a) by induction on n or by induction on m), but also a choice of whether to leave the other variables fixed. For example, let us try to prove Theorem 2.26 (a) by induction on n while leaving the variable m fixed. That is, we fix some m ∈ N, and we define A(n) (for each n ∈ N) to be the following statement:

(xn+m+1=bxnxm+xn+1xm+1).

Then, it is easy to check that A(0) holds, so the induction base is complete.

For the induction step, we fix some k ∈ N. (This k serves the role of the “m”

in Theorem 2.1, but we cannot call it m here since m already stands for a fixed number.) We assume that A(k) holds, and we intend to proveA(k+1).

Our induction hypothesis says that A(k) holds; in other words, we have xk+m+1 = bxkxm+xk+1xm+1. We want to prove A(k+1); in other words, we want to prove that x(k+1)+m+1 =bxk+1xm+x(k+1)+1xm+1.

A short moment of deliberation shows that we cannot do this (at least not with our current knowledge). There is no direct way of derivingA(k+1)fromA(k). However, if we knew that the statement A(k) holds “for m+1 instead of m”

(that is, if we knew that xk+(m+1)+1 = bxkxm+1+xk+1x(m+1)+1), then we could derive A(k+1). But we cannot just “apply A(k) to m+1 instead of m”; after all, m is a fixed number, so we cannot have it take different values in A(k) and inA(k+1).

So we are at an impasse. We got into this impasse by fixing m. So let us try not fixing m ∈ Nright away, but instead defining A(n) (for each n ∈ N) to be the following statement:

(xn+m+1 =bxnxm+xn+1xm+1 for all m∈ N).

Thus, A(n) is not a statement about a specific integer m any more, but rather a statement about all nonnegative integers m. This allows us to apply A(k) to m+1 instead of m in the induction step. (We can still fix m ∈ N during the induction step; this doesn’t prevent us from applyingA(k) to m+1 instead of m, since A(k) has been formulated before m was fixed.) This way, we arrive at the following proof:

Proof of Theorem 2.26. (a)We claim that for each n∈ N, we have

(xn+m+1 =bxnxm +xn+1xm+1for all m ∈N). (59) Indeed, let us prove (59) by induction onn:

Induction base: We havex0+m+1 =bx0xm +x0+1xm+1 for allm ∈N 45. In other words, (59) holds for n=0. This completes the induction base.

Induction step: Let k ∈ N. Assume that (59) holds for n= k. We must prove that (59) holds forn =k+1.

We have assumed that (59) holds forn =k. In other words, we have

(xk+m+1 =bxkxm+xk+1xm+1for all m ∈N). (60) Now, let m ∈ N. We have m+2 ≥ 2; thus, the recursive definition of the sequence(x0,x1,x2, . . .) yields

xm+2 =a x(m+2)−1

| {z }

=xm+1

+b x(m+2)−2

| {z }

=xm

= axm+1+bxm. (61)

The same argument (with mreplaced byk) yields

xk+2 =axk+1+bxk. (62)

But we can apply (60) tom+1 instead of m. Thus, we obtain xk+(m+1)+1 =bxkxm+1+xk+1 x(m+1)+1

| {z }

=xm+2=axm+1+bxm

(by (61))

=bxkxm+1+xk+1(axm+1+bxm)

| {z }

=axk+1xm+1+bxk+1xm

=bxkxm+1+axk+1xm+1

| {z }

=(axk+1+bxk)xm+1

+bxk+1xm

= (axk+1+bxk)

| {z }

=xk+2 (by (62))

xm+1+bxk+1xm =xk+2xm+1+bxk+1xm

=bxk+1xm+ xk+2

| {z }

=x(k+1)+1

xm+1 =bxk+1xm+x(k+1)+1xm+1.

In view of k+ (m+1) +1= (k+1) +m+1, this rewrites as x(k+1)+m+1 =bxk+1xm+x(k+1)+1xm+1.

Now, forget that we fixed m. We thus have shown that x(k+1)+m+1 = bxk+1xm+ x(k+1)+1xm+1for allm∈ N. In other words, (59) holds forn=k+1. This completes the induction step. Thus, (59) is proven.

45Proof. LetmN. Then,x0+m+1= xm+1. Comparing this withb x0

|{z}

=0

xm+ x0+1

| {z }

=x1=1

xm+1 =b0xm+ 1xm+1=xm+1, we obtainx0+m+1=bx0xm+x0+1xm+1, qed.

Hence, Theorem 2.26(a)holds.

(b)Fix n∈ N. We claim that

xn | xnw for eachw ∈N. (63)

Indeed, let us prove (63) by induction onw:

Induction base: We have xn·0 = x0 = 0 = 0xn and thus xn | xn·0. In other words, (63) holds forw =0. This completes the induction base.

Induction step: Let k ∈N. Assume that (63) holds for w=k. We must now prove that (63) holds for w=k+1. In other words, we must prove that xn | xn(k+1).

If n = 0, then this is true46. Hence, for the rest of this proof, we can WLOG assume that we don’t haven =0. Assume this.

We have assumed that (63) holds forw =k. In other words, we have xn | xnk. In other words,xnk ≡0 modxn. 47 Likewise, from xn | xn, we obtainxn ≡0 modxn. We have n ∈ N but n 6= 0 (since we don’t have n = 0). Hence, n is a positive integer. Thus, n−1 ∈ N. Therefore, Theorem 2.26 (a) (applied to nk and n−1 instead ofnand m) yields

xnk+(n1)+1=bxnkxn1+xnk+1x(n1)+1. In view of nk+ (n−1) +1=n(k+1), this rewrites as

xn(k+1) =b xnk

|{z}

0 modxn

xn1+xnk+1 x(n1)+1

| {z }

=xn0 modxn

≡b0xn1+xnk+10 =0 modxn.

48Thus, we have shown thatxn(k+1) ≡0 modxn. In other words,xn | xn(k+1) (again, this follows from Proposition 2.11 (a)). In other words, (63) holds for w = k+1.

This completes the induction step. Hence, (63) is proven by induction.

46Proof. Let us assume thatn =0. Then,xn(k+1) = x0(k+1)= x0= 0= 0xn, and thusxn | xn(k+1), qed.

47Here, again, we have used Proposition 2.11(a) (applied toxnk andxn instead of aandn). This argument is simple enough that we will leave it unsaid in the future.

48We have used substitutivity for congruences in this computation. Here is, again, a way to rewrite it without this use:

We have xn(k+1)= bxnkxn−1+xnk+1x(n−1)+1. Butbbmodxn (by Proposition 2.12(a)) and xn−1 xn−1modxn (for the same reason) and xnk+1 xnk+1modxn (for the same reason).

Now, Proposition 2.21 (c) (applied to b, b, xnk, 0 and xn instead of a, b, c, d and n) yields bxnkb0 modxn (sincebbmodxn andxnk0 modxn). Hence, Proposition 2.21(c)(applied tobxnk,b0,xn−1,xn−1andxn instead ofa,b,c,dandn) yieldsbxnkxn−1b0xn−1modxn (since bxnk b0 modxn and xn−1 xn−1modxn). Also, xnk+1x(n−1)+1 xnk+1x(n−1)+1modxn (by Proposition 2.12(a)). Hence, Proposition 2.21 (a) (applied tobxnkxn−1, b0xn−1, xnk+1x(n−1)+1, xnk+1x(n−1)+1andxn instead ofa,b,c,dandn) yields

bxnkxn−1+xnk+1x(n−1)+1b0xn−1+xnk+1x(n−1)+1modxn

(sincebxnkxn−1b0xn−1modxn andxnk+1x(n−1)+1xnk+1x(n−1)+1modxn).

Also, Proposition 2.21 (c) (applied to xnk+1, xnk+1, x(n−1)+1, 0 and xn instead of a, b, c, d andn) yieldsxnk+1x(n−1)+1xnk+10 modxn (sincexnk+1 xnk+1modxn and x(n−1)+1= xn 0 modxn). Furthermore,b0xn−1 b0xn−1modxn (by Proposition 2.12(a)). Finally, Proposition

This proves Theorem 2.26(b).

(c) Theorem 2.26 (c) can be derived from Theorem 2.26 (b) in the same way as Theorem 2.24(c)was derived from Theorem 2.24(b).

Applying Theorem 2.26(a)to a=1 and b =1, we obtain the equality fn+m+1 = fnfm+ fn+1fm+1 noticed in Example 2.25. Applying Theorem 2.26 (c)to a=1 and b =1, we obtain the observation about divisibility made in Example 2.25.

Note that part(a)of Theorem 2.26 still works if aand bare real numbers (instead of being integers). But of course, in this case, (x0,x1,x2, . . .) will be merely a se-quence of real numbers (rather than a sese-quence of integers), and thus parts(b)and (c)of Theorem 2.26 will no longer make sense (since divisibility is only defined for integers).