- プログラミングのお題スレ Part5
223 :デフォルトの名無しさん[sage]:2014/10/06(月) 15:54:33.94 ID:xPSCLTwu - >>164 Emacs Lisp
(require 'cl-lib) cl-lib (require 'calc) calc (defmath f (n) (let ((l (reverse (list 0 1 2 3)))) (cond ((<= n 4) (nth (1- n) (reverse l))) (t (cl-dotimes (i (- n 4)) (push (+ (nth 0 l) (nth 1 l) (nth 2 l) (nth 3 l)) l)) (car l))))) calcFunc-f (cl-loop for i from 1 to 10 collect (calcFunc-f i)) (0 1 2 3 6 12 23 44 85 164) (substring (let ((s (cl-loop for x in (mapcar (lambda (x) (format "%04d" x)) (reverse (cdr (calcFunc-f 10000)))) concat x))) (let ((a (string-match "[^0]" s))) (if a (substring s a) s))) 0 50) "28058566764257248608122072881910525085551777891599"
|