OFFSET
0,3
LINKS
FORMULA
Other identities:
For all n >= 1, a(n!) = n.
EXAMPLE
For n = 0, with factorial base representation (A007623) "0", there are no ones present at all, thus a(0) = 0.
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.
For n = 6, with representation "100", the rightmost one occurs at position 3, thus a(6) = 3.
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.
MATHEMATICA
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 *)
PROG
(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))))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 29 2015
STATUS
approved