//right-hand has a variable n more with fibs function(defun fibs (n)(if (eq n 1) 2 (if (eq n 2) 3 (+ n 10 (- (* 6 (fibs (- n 1) ) ) (* 8 (fibs (- n 2) ) ))))))GOf(t+2)-6*f(t+1)+8*f(t)={n+2}+10f(t+3)-6*f(t+2)+8*f(t+1)={n+3}+10GO ( below minus above)f(t+3)-7*f(t+2)+14*f(t+1)-8*f(t)=1
same as abovef(t+4)-7*f(t+3)+14*f(t+2)-8*f(t+1)=1GO(X-2)(X-1)(X-1)(X-4)=0GO2*A+4*B+C+D=24*A+16*B+C+2*D=38*A+64*B+C+3*D=158*A+128*B+C+4*D=35GO解方程可以获得ABCD的值。
(defun pow (num count)(if (> count 0) (* num (pow num (- count 1) ) ) 1))
(setq A (- 0 (/ 16 7.0)) )(setq B (/ 109 253.0))(setq C (/ 281 63.0))(setq D (/ 8 21.0))
(defun formula (n)(+ (* A (pow 2 n)) (* B (pow 4 n)) C (* D n)))
(defun test (n)(if (> n 0) (progn (print (formula n)) (print (fibs n)) (test (- n 1) )) (print 'over)))
(test 10)
//经过验证,结果是非常精确的。