OFFSET
0,5
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..3120
PROG
(Scheme)
(define (A099564 n) (let loop ((n n) (i 3)) (let* ((f (A000045 i)) (dig (modulo n f)) (next-n (/ (- n dig) f))) (if (zero? next-n) dig (loop next-n (+ 1 i))))))
;; Standalone version:
(define (A099564 n) (let loop ((n n) (f1 1) (f2 2)) (let* ((dig (modulo n f2)) (next-n (/ (- n dig) f2))) (if (zero? next-n) dig (loop next-n f2 (+ f1 f2))))))
;; Antti Karttunen, Aug 23 2016
CROSSREFS
Differs from A099563 for the first time at n=24.
KEYWORD
nonn
AUTHOR
John W. Layman, Oct 22 2004
EXTENSIONS
a(0) = 0 prepended and the name corrected by Antti Karttunen, Aug 23 2016
STATUS
approved