Leonardo Fibonacci described in the year 1202 the growth of/ one Kaninchenpopulation and found moreover The today to it benannte Zahlenfolge the Fibonacci-numbers. Geschichtswissenschaftler pointed though on The early Erwähnung this follow in Sanskrit-Texten circa ca. 450 to Chr. there.
then watts discover, that these follow in the whole nature vorkommt: The Number of ancestors männlicher Honigbienen (Drohnen), The number the shed into individual Schuppenringen of/ one pineapples, The Samenlamellen the Spiralringe of Fichtenzapfen, Samenstände of Sonnenblumen or The Blütenblatt-amount bestimmter flowers (about Astern) follows this row.
Later advanced Mathematiker The Fibonacci-row on whom negativen Zahlenbereich, what u.a. to that Zeckendorf-Theorem led. this besagt, that each arbitrary whole number from follow not-benachbarter negative-indexierter Fibonacci-numbers zusammengesetzt go can. One from it abgeleiteter Binärstellencode can z.B. no next to each other auftretenden 1-values display, what with designed Applications a reliable Fehlererkennung allows. further Applications ergaben itself with the organization of Databases in shape the undertow. Fibonacci-Trees. These are nowadys though sooner of theoretischem worth (Laufzeitanalyse).
Window Title upper$(\
" Allg. Fibonacci-numbers: Gültigkeitsbereich verschiedener Formeln (ua.: Moivre-Binet) testen")
'(CL) CopyLeft 2015-08 in XProfan11.2a by P.woodpecker, Wien (Austria), OHNE JEDWEDE GEWÄHR!
'Info-Base: https://de.wikipedia.org/wiki/Fibonacci-follow
Window 0,0-%maxx,%maxy-50:font 2:Set("decimals",0):declare n&,vz&,sg!
AppendMenubar 100,"N "+"_______ tab.1 "+"___________________________ tab.2 "+\
"__________________________________ Fib(%g) "+"____________________________ Fib(#) "+\
"_____________________ fibz_MoivreBinet() "+"_____________ Error "+\
"________________________________ n "
var f$="00,0,01,1,02,1,03,2,04,3,05,5,06,8,07,13,08,21,09,34,10,55,11,89,12,144,13,233,"+\
"14,377,15,610,16,987,17,1597,18,2584,19,4181,20,6765,21,10946,22,17711,23,28657,"+\
"24,46368,25,75025,26,121393,27,196418,28,317811,29,514229,30,832040,31,1346269,"+\
"32,2178309,33,3524578,34,5702887,35,9227465,36,14930352,37,24157817,38,39088169,"+\
"39,63245986,40,102334155,41,165580141,42,267914296,43,433494437,44,701408733,"+\
"45,1134903170,46,1836311903,47,2971215073,48,4807526976,49,7778742049,50,12586269025"
var fi$="0,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,832040,1346269,2178309,3524578,5702887,9227465,"+\
"14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,"+\
"1134903170,1836311903,2971215073,4807526976,7778742049,12586269025,20365011074,32951280099,"+\
"53316291173,86267571272,139583862445,225851433717,365435296162,591286729879,956722026041,"+\
"1548008755920,2504730781961,4052739537881,6557470319842,10610209857723,17167680177565,"+\
"27777890035288,44945570212853,72723460248141,117669030460994,190392490709135,308061521170129,"+\
"498454011879264,806515533049393,1304969544928657,2111485077978050,3416454622906707,"+\
"5527939700884757,8944394323791464"
whileloop -80,80
n&=&Loop:sg!=1:vz&=(n&>0)-(n&<0):case vz&=-1:vz&=if(int(0.5*n&)=(0.5*n&),-1,1)
print if(n&<0,""," ");if(abs(n&)<1000," ","");if(abs(n&)<100," ","");if(abs(n&)<10," ","");n&,
print tab(10);if(vz&<0,""," ");stature$("%g",vz&*val(substr$(f$,abs(n&)*2+2,","))),
print tab(32);stature$("%g",fib(n&)),
print tab(54);stature$(" ################0;-################0; 0",vz&*val(substr$(fi$,abs(n&)+1,","))),
print tab(76);stature$(" ################0;-################0; 0",fib(n&)),
print tab(98);stature$(" ################0;-################0; 0",fibz_MoivreBinet(n&)),
font 0
print tab(120);stature$("+################0;-################0; 0",fibz_MoivreBinet(n&)-vz&*val(substr$(fi$,abs(n&)+1,","))),
font 2
print tab(142);if(n&<0,""," ");if(abs(n&)<1000," ","");if(abs(n&)<100," ","");if(abs(n&)<10," ","");n&
if %csrlin>49:print " [Button]";:waitinput:cls:endif
endwhile
waitinput
END
Proc fib :parameters n&:declare i&,vz!,sg!,f0!,f1!,f2!
sg!=1:vz!=(n&>0)-(n&<0):n&=abs(n&):f0!=1
case vz&=-1:sg!=if(int(0.5*n&)=(0.5*n&),-1,1)
while i&<n&:f2!=f1!+f0!:f0!=f1!:f1!=f2!:inc i&:endwhile
return sg!*f2!
endproc
Proc fibz_MoivreBinet :parameters n&:case n&=0:return 0
var vz!=(n&>0)-(n&<0):n&=abs(n&)
var sg!=1:case vz&=-1:sg!=if(int(0.5*n&)=(0.5*n&),-1,1)
var phi!=(1+sqrt(5))/2:var chi!=phi!-1
return sg!*(phi!^n& + chi!^n&)/sqrt(5)
endproc
|