OFFSET
0,3
COMMENTS
Leading zeros in factorial base representation of n are ignored.
LINKS
FORMULA
EXAMPLE
The first terms, in decimal and in factorial base, are:
n a(n) f(n) f(a(n))
-- ---- ---- -------
0 0 0 0
1 1 1 1
2 2 10 10
3 4 11 20
4 1 20 1
5 3 21 11
6 6 100 100
7 12 101 200
8 12 110 200
9 18 111 300
10 8 120 110
PROG
(PARI) a(n) = { my (f=[]); for (r=2, oo, if (n==0, return (sum(k=1, #f, f[k]*(#f-k+1)!)), f=concat(f, 0); my (d=n%r); n\=r; if (d, f[d]++))) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 02 2021
STATUS
approved