login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A099564
a(0) = 0; for n > 0, a(n) = final nonzero number in the sequence n, f(n,2), f(f(n,2),3), f(f(f(n,2),3),4),..., where f(n,d)=Floor(n/F(d+1)), with F denoting the Fibonacci numbers (A000045).
6
0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
0,5
COMMENTS
Records in {a(n)} are given in A099565.
a(n) gives the most significant digit of n when written in "base A003266", like A099563 and A276153 give the most significant digit in bases A000142 and A002110 respectively. - Antti Karttunen, Aug 23 2016
LINKS
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
Cf. A000045, A003266, A099565 (positions of records).
Differs from A099563 for the first time at n=24.
Differs from A276153 for the first time at n=210, where a(210)=7, while A276153(210)=1.
Sequence in context: A118164 A337198 A099563 * A341356 A276153 A341348
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