Cassini's identity 2026-10-20
For the Fibonacci numbers , , the identity holds for . It follows by induction: replacing each term using the Fibonacci recurrence negates the left-hand side when increases by one, and the value at is .
Fibonacci word 2026-10-20
A word formed recursively by concatenating the previous two words in a specified order, for example from two seed words. Lengths satisfy the Fibonacci recurrence. To locate a symbol, compare its index with the first block's length, choose the containing block, and subtract the first length when entering the second block. This avoids constructing an exponentially long word.
The base case is , so . To relate successive blocks of five, use the Fibonacci addition formula:This identity can also be obtained simply by applying the Fibonacci recurrence five times. If the mathematical induction hypothesis is , thenis a sum of two multiples of five. HenceThe generalisation is Fibonacci multiple-index divisibility:Indeed, , so precisely the same mathematical induction works with replaced by .
Use mathematical induction with the defining Fibonacci recurrence. Both identities hold at : their two sides are zero. If the first holds at , thenIf the second holds at , thenEach inductive hypothesis therefore advances to .
Keep the two adjacent Fibonacci numbers in one shared pair. From the Fibonacci recurrence, if the current pair is , the next is . This gives the paired Fibonacci recurrence:
twoFibs :: Integer -> (Integer, Integer)
twoFibs 0 = (0, 1)
twoFibs n
| n > 0 = let (a, b) = twoFibs (n - 1)
in (b, a + b)
| otherwise = error "negative Fibonacci index"
fib :: Integer -> Integer
fib = fst . twoFibsThe pair pattern shares the result of the single recursive call. Mathematical induction establishesThere are pair updates and additions, rather than the repeated subcomputations of the original branching recursion. This is linear arithmetic-operation count; exact Fibonacci numbers have growing bit length. The pattern
fib (n+2) in the source expresses the recurrence; the guarded definition above uses ordinary Haskell syntax without requiring an n+k pattern extension.Let . The equations derived in part (e) become and , where . Replacing zero and successor by that seed and step is exactly a natural-number fold:
twoFibsNat :: Natural -> (Integer, Integer)
twoFibsNat = foldNat step (0, 1)
where
step :: (Integer, Integer) -> (Integer, Integer)
step (a, b) = (b, a + b)
fibNat :: Natural -> Integer
fibNat = fst . twoFibsNatConsequentlyStructural induction follows the constructors of
Natural: the seed gives the first two Fibonacci numbers, and the successor step uses the Fibonacci recurrence. The extra component carries exactly the information needed for the next update.We prove Cassini's identity by mathematical induction. At ,Suppose . The Fibonacci recurrence gives and henceThe induction proves
If it holds at and , then the Fibonacci recurrence givesThe identities and turn the numerator into . Thus
The linearity of the Fibonacci recurrence allows a linear combinationThe initial conditions give and . Since , we obtain and . Thus Binet's formula is
A direct mathematical induction proves . The base cases and hold. If the bound holds at and , then the Fibonacci recurrence givesThus the definition of big O notation holds with , proving
Put ; the other summands in the printed sum vanish. The initial values are and . For , Pascal's identity givesFor the first sum, when is even its final term is zero; otherwise its range already agrees with . In the second sum put , obtaining for . Thus both range identifications hold without negative upper arguments in a binomial coefficient.
Fix and use mathematical induction on with two initial cases, as appropriate for the second-order Fibonacci recurrence. At , the right side is . At , it is .
Suppose the formula holds at . Adding the next Fibonacci number with its sign and using the Fibonacci recurrence givesThis is the required successor case. Thus
The Fibonacci recurrence, with the supplied initial values, is for , with . Two initial values are needed for this second-order linear recurrence relation.
Adding the Fibonacci recurrence and the identical recurrence relation for the Lucas numbers givesLinearity preserves this linear recurrence relation; the initial values come from and .
Induct on , with the claim quantified over every . At ,Suppose the identity holds for a fixed and every . For , the Fibonacci recurrence givesApplying the induction hypothesis with is legitimate. This proves throughout its domain, a case of the Fibonacci determinant identity.
For , the difference is . Define . The Fibonacci recurrence givesThe inductive step therefore changes into . By mathematical induction, for all , the requested form of Cassini's identity.
Use mathematical induction with two consecutive base cases: and . Suppose the bounds hold for exponents and . The Fibonacci recurrence givesThus the consecutive pair of bounds advances one step. for every .
Feed each returned output back as the next input to the same channel software object:
class RepeatedChannel(inner: Channel, times: Int) extends Channel {
require(times > 0)
override def apply(n: Int): Int = {
var value = n
var completed = 0
while (completed < times) {
value = inner(value)
completed += 1
}
value
}
}The loop invariant says that
value and the component's current state are exactly those after completed successive applications starting from this invocation's input and the entry state. The loop variant is times - completed. On exit the specified number of applications has occurred; the component is not reset or replaced between them.For input one and a freshly created sum channel, the successive outputs areInitially the component's previous input is zero. The first output is one; on each later call its previous-input state is the input used on the preceding call. Consequently outputs follow the Fibonacci recurrence with initial outputs one and two. The answer is 89, rather than the result of repeatedly supplying the unchanged external input or recreating the component at every iteration. The component retains its final state for later wrapper calls.
Two-coefficient reduction of matrix powers 2026-10-18
Consider the real matrixThe Cayley-Hamilton theorem gives . ConsequentlyThusAll four entries come from just two scalar coefficients. If , multiplying once by and replacing gives the linear recurrence relationEquivalently , with . The appearance of Fibonacci numbers is explained by , where advances the Fibonacci recurrence. No eigenvectors need to be computed.
Cayley–Hamilton reduces powers of a chosen two-by-two matrix to two integer coefficients; the fifth power is 55A − 21I
. Details. The same identity computes an inverse. Rearrange it as , givingThis works because the constant term of this characteristic polynomial is nonzero and the coefficients lie in a field. Generally, when over a field, rearranging the Cayley-Hamilton theorem expresses as a polynomial evaluated at a matrix. Over a general commutative ring, a nonzero constant need not be a unit; invertibility requires that extra condition.
