Test of the Per9000FibLib author: Per Erik Strandberg, www.pererikstrandberg.se This Fibonacci Library can work with huge integers Let us play with 1337^42 = 198389692832016689128025814051186435469808931027259980194805041212767924492279648804437095653839742535006120000819629040274718649969 This integer has has approximately 132 digits. The largest fibonaccinumber less than 1337^42 is: 126981576631475750014906387931931581692734251880848776469071481399496762848826070039224556421753327196738843828004058553268696153829. Let us now instead play with 123456789012345678901234567890123 i find that this new integer is enclosed in two fibonacci number as follows: 110560307156090817237632754212345 < 123456789012345678901234567890123 < 178890334785183168257455287891792 Zeckendorf's representation: this integer is composed of the following sum of fibonacci numbers: F(154) = 110560307156090817237632754212345 F(149) = 9969216677189303386214405760200 F(146) = 2353412818241252672952597492098 F(143) = 555565404224292694404015791808 F(135) = 11825896447871834976429068427 F(133) = 4517090495650391871408712937 F(131) = 1725375039079340637797070384 F(126) = 155576970220531065681649693 F(124) = 59425114757512643212875125 F(118) = 3311648143516982017180081 F(112) = 184551825793033096366333 F(110) = 70492524767089125814114 F(107) = 16641027750620563662096 F(105) = 6356306993006846248183 F(103) = 2427893228399975082453 F(99) = 354224848179261915075 F(95) = 51680708854858323072 F(91) = 7540113804746346429 F(87) = 1100087778366101931 F(83) = 160500643816367088 F(75) = 3416454622906707 F(73) = 1304969544928657 F(69) = 190392490709135 F(67) = 72723460248141 F(61) = 4052739537881 F(59) = 1548008755920 F(55) = 225851433717 F(52) = 53316291173 F(50) = 20365011074 F(46) = 2971215073 F(40) = 165580141 F(37) = 39088169 F(35) = 14930352 F(29) = 832040 F(27) = 317811 F(23) = 46368 F(21) = 17711 F(11) = 144 F(8) = 34 F(3) = 3 A Fibonacci Code representation of this number is thus: 0010000100100000 0000101000101000 0010100100000100 0101001000101000 0010100010100000 0010001000100010 0010001010100101 0000010000010100 0010101000000010 01001000011 Decoding this code gives us: 123456789012345678901234567890123 control: 123456789012345678901234567890123 - 123456789012345678901234567890123 ------------------------------------ = 0 (which is nice) Test of the function isfib(n): Positive numbers less than 100 that are fib's are: 1 2 3 5 8 13 21 34 55 89 Positive numbers less than 20 that are not fib's are: 4 6 7 9 10 11 12 14 15 16 17 18 19