cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

John W. Layman, Oct 22 2004

Keywords

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

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.

Programs

  • 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

Extensions

a(0) = 0 prepended and the name corrected by Antti Karttunen, Aug 23 2016