12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

E. LATEX AND TEX\advance\@tempdima -\textwidth % minus the textwidth\advance\@tempdima -\spinemargin % minus the spinemargin\ifdim\@tempdima < \@tempdimb % should be close to zero%% error % otherwise a problem\fiChanging the subject, on the offchance that you might want to see how the Fibonaccisequence progresses, the first thirty numbers in the sequence are: 1, 1, 2, 3, 5, 8, 13, 21,34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368,75025, 121393, 196418, 317811, 514229 and 832040. I got La<strong>TeX</strong> to calculate those numbersfor me, and it could have calculated many more. <strong>The</strong>y were produced by just saying\fibseries{30}. <strong>The</strong> French mathematician Édouard Lucas (1842–1891) studied sequenceslike this and was the one to give it the name Fibonacci. Lucas also invented thegame called the Tower of Hanoi with Henri de Parville (1838–1909), supplying the accompanyingfable [dP84, RBC74]:In the great temple at Benares beneath the dome that marks the center ofthe world, rests a brass plate in which are fixed three diamond needles, eacha cubit high and as thick as the body of a bee. On one of these needles, at thecreation, God placed sixty-four discs of pure gold, the largest disc resting on thebrass plate, and the others getting smaller and smaller up to the top one. This isthe tower of Bramah. Day and night unceasingly the priests transfer the discsfrom one diamond needle to another according to the fixed and immutablelaws of Bramah, which require that the priest on duty must not move morethan one disc at a time and that he must place this disc on a needle so thatthere is no smaller disc below. When the sixty-four discs shall have been thustransferred from the needle which at creation God placed them, to one of theother needles, tower, temple, and Brahmins alike will crumble into dust andwith a thunderclap the world will vanish.<strong>The</strong> number of separate transfers of single discs is 2 64 − 1 or just under eighteen anda half million million moves, give or take a few, to move the pile. At the rate of one discper second, with no mistakes, it would take more than 58 million million years before wewould have to start being concerned.In his turn, Lucas has a number sequence named after him. <strong>The</strong>re are many relationshipsbetween the Fibonacci numbers F n and the Lucas numbers L n , the simplest, perhaps,beingL n = F n−1 + F n+1 (E.1)5F n = L n−1 + L n+1 (E.2)<strong>The</strong> first 15 numbers in the Lucas sequence are: 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199,322, 521 and 843. <strong>The</strong>se were produced by saying \gfibseries{2}{1}{15}. <strong>The</strong> Lucasnumbers are produced in the same manner as the Fibonacci numbers, it’s just the startingpairs that differ.However, it is the definition of the \fibseries and \gfibseries macros that mightbe more interesting in this context.First, create four new counts. \fibtogo is the number of terms to be calculated, \fibis the current term, and \fibprev and \fibprevprev are the two prior terms.442

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!