login
A368160
For any n > 0, a(n) is obtained by interpreting the factorial base expansion of n in base m + 1, where m is the maximum digit in the factorial base expansion of n; a(0) = 0.
1
0, 1, 2, 3, 6, 7, 4, 5, 6, 7, 15, 16, 18, 19, 21, 22, 24, 25, 48, 49, 52, 53, 56, 57, 8, 9, 10, 11, 33, 34, 12, 13, 14, 15, 42, 43, 45, 46, 48, 49, 51, 52, 112, 113, 116, 117, 120, 121, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, 75, 76, 78, 79
OFFSET
0,3
COMMENTS
Every nonnegative integer appears finitely many times in this sequence.
FORMULA
a(A059590(n)) = n.
a(k!) = 2^(k-1) for any k > 0.
EXAMPLE
For n = 42: the factorial base expansion of 42 is "1300" and has maximum digit 3, so the base-4 expansion of a(42) is "1300", and a(42) = 112.
PROG
(PARI) a(n) = { my (d = []); for (r = 2, oo, if (n==0, return (if (#d, fromdigits(d, vecmax(d)+1), 0)), d = concat(n%r, d); n \=r; ); ); }
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Dec 14 2023
STATUS
approved