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 A257261 #18 Feb 07 2024 01:17:34 %S A257261 0,1,2,1,0,1,3,1,2,1,3,1,0,1,2,1,0,1,0,1,2,1,0,1,4,1,2,1,4,1,3,1,2,1, %T A257261 3,1,4,1,2,1,4,1,4,1,2,1,4,1,0,1,2,1,0,1,3,1,2,1,3,1,0,1,2,1,0,1,0,1, %U A257261 2,1,0,1,0,1,2,1,0,1,3,1,2,1,3,1,0,1,2,1,0,1,0,1,2,1,0,1,0,1,2,1,0,1,3,1,2,1,3,1,0,1,2,1,0,1,0,1,2,1,0,1,5 %N A257261 One-based position of the rightmost one in the factorial base representation (A007623) of n, 0 if no one is present. %H A257261 Antti Karttunen, <a href="/A257261/b257261.txt">Table of n, a(n) for n = 0..10081</a> %H A257261 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>. %F A257261 Other identities: %F A257261 For all n >= 1, a(n!) = n. %e A257261 For n = 0, with factorial base representation (A007623) "0", there are no ones present at all, thus a(0) = 0. %e A257261 For n = 1, with representation "1", the rightmost one occurs at digit-position 1 (when the least significant digit has index 1, etc.), thus a(1) = 1. %e A257261 For n = 6, with representation "100", the rightmost one occurs at position 3, thus a(6) = 3. %e A257261 For n = 11, with representation "121", the rightmost one occurs at digit-position 1 (when the least significant digit has index 1, etc.), thus a(11) = 1. %t A257261 a[n_] := Module[{k = n, m = 2, r, s = {}, p}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; If[MissingQ[(p = FirstPosition[s, 1])], 0, p[[1]]]]; Array[a, 100, 0] (* _Amiram Eldar_, Feb 07 2024 *) %o A257261 (Scheme) (define (A257261 n) (let loop ((n n) (i 2)) (cond ((zero? n) 0) ((= 1 (modulo n i)) (- i 1)) (else (loop (floor->exact (/ n i)) (+ 1 i)))))) %Y A257261 Cf. A007623, A257260. %Y A257261 Cf. A000142 (positions of records, where each n first occurs as a value), A255411 (positions of zeros), A000012 (odd bisection). %K A257261 nonn,base %O A257261 0,3 %A A257261 _Antti Karttunen_, Apr 29 2015