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.
%I A099563 #33 Mar 10 2021 07:23:26 %S A099563 0,1,1,1,2,2,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1, %T A099563 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, %U A099563 2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4 %N A099563 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/d); the most significant digit in the factorial base representation of n. %C A099563 Records in {a(n)} occur at {1,4,18,96,600,4320,35280,322560,3265920,...}, which appears to be n*n! = A001563(n). %C A099563 The most significant digit in the factorial expansion of n (A007623). Proof: The algorithm that computes the factorial expansion of n, generates the successive digits by repeatedly dividing the previous quotient with successively larger divisors (the remainders give the digits), starting from n itself and divisor 2. As a corollary we find that A001563 indeed gives the positions of the records. - _Antti Karttunen_, Jan 01 2007. %H A099563 Antti Karttunen, <a href="/A099563/b099563.txt">Table of n, a(n) for n = 0..10080</a> %H A099563 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a> %F A099563 From _Antti Karttunen_, Dec 25 2015: (Start) %F A099563 a(0) = 0; for n >= 1, if A265333(n) = 1 [when n is one of the terms of A265334], a(n) = 1, otherwise 1 + a(A257684(n)). %F A099563 Other identities. For all n >= 0: %F A099563 a(A001563(n)) = n. [Sequence works as a left inverse for A001563.] %F A099563 a(n) = A257686(n) / A048764(n). %F A099563 (End) %e A099563 For n=15, f(15,2) = floor(15/2)=7, f(7,3)=2, f(2,4)=0, so a(15)=2. %e A099563 From _Antti Karttunen_, Dec 24 2015: (Start) %e A099563 Example illustrating the role of this sequence in factorial base representation: %e A099563 n A007623(n) a(n) [= the most significant digit]. %e A099563 0 = 0 0 %e A099563 1 = 1 1 %e A099563 2 = 10 1 %e A099563 3 = 11 1 %e A099563 4 = 20 2 %e A099563 5 = 21 2 %e A099563 6 = 100 1 %e A099563 7 = 101 1 %e A099563 8 = 110 1 %e A099563 9 = 111 1 %e A099563 10 = 120 1 %e A099563 11 = 121 1 %e A099563 12 = 200 2 %e A099563 13 = 201 2 %e A099563 14 = 210 2 %e A099563 15 = 211 2 %e A099563 16 = 220 2 %e A099563 17 = 221 2 %e A099563 18 = 300 3 %e A099563 etc. %e A099563 Note that there is no any upper bound for the size of digits in this representation. %e A099563 (End) %t A099563 Table[Floor[n/#] &@ (k = 1; While[(k + 1)! <= n, k++]; k!), {n, 0, 120}] (* _Michael De Vlieger_, Aug 30 2016 *) %o A099563 (PARI) A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); }; \\ _Antti Karttunen_, Dec 24 2015 %o A099563 (Scheme) %o A099563 (define (A099563 n) (let loop ((n n) (i 2)) (let* ((dig (modulo n i)) (next-n (/ (- n dig) i))) (if (zero? next-n) dig (loop next-n (+ 1 i)))))) %o A099563 (definec (A099563 n) (cond ((zero? n) n) ((= 1 (A265333 n)) 1) (else (+ 1 (A099563 (A257684 n)))))) ;; Based on given recurrence, using the memoization-macro definec %o A099563 ;; _Antti Karttunen_, Dec 24-25 2015 %o A099563 (Python) %o A099563 def a(n): %o A099563 i=2 %o A099563 d=0 %o A099563 while n: %o A099563 d=n%i %o A099563 n=(n - d)//i %o A099563 i+=1 %o A099563 return d %o A099563 print([a(n) for n in range(201)]) # _Indranil Ghosh_, Jun 21 2017, after PARI code %Y A099563 Cf. A001563, A007623, A099564. %Y A099563 Cf. also A034968, A048764, A051683, A055881, A126307, A230420, A246359, A249069, A257679, A257684, A257686, A257687, A265890, A265891, A265894, A265333, A265334. %K A099563 nonn %O A099563 0,5 %A A099563 _John W. Layman_, Oct 22 2004 %E A099563 a(0) = 0 prepended and the alternative description added to the name-field by _Antti Karttunen_, Dec 24 2015