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

A265893
a(n) = A084558(n) - A230403(n); the length of factorial base representation of n without its trailing zeros.
2
0, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1
OFFSET
0,4
FORMULA
a(n) = A084558(n) - A230403(n).
EXAMPLE
In factorial base A007623, 0 is shown as "0", but in this case all the zeros are trailing, so we set a(0) = 0 by convention.
For n = 2, A007623(2) = "10", and by discarding the trailing zero only one significant digit "1" is left, thus a(2) = 1.
For n = 132, A007623(132) = "10200", and by discarding its trailing zeros we are left with just three digits "102", thus a(132) = 3.
MATHEMATICA
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Length[s] - FirstPosition[s, _?(#>0 &)][[1]] + 1]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Feb 21 2024 *)
PROG
(Scheme) (define (A265893 n) (- (A084558 n) (A230403 n)))
CROSSREFS
Column 1 of A265892.
Sequence in context: A143773 A323524 A354713 * A191372 A185316 A053279
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 20 2015
STATUS
approved