OFFSET
1,2
COMMENTS
For n > 0, write n as sum(k = 0 to m, d_k*k!), where m is such that m! < n <= (m+1)!. Conditions d_0 = 1, 0 <= d_k <= k for k > 0 ensure that the representation is unique. a(n) is the concatenation of (the digits) d_m, ..., d_1, d_0.
a(n) is obtained by appending "1" to A007623(n-1), the standard factorial base representation of n-1.
REFERENCES
J. S. Madachy & J. A. H. Hunter, Mathematical Diversions, pp. 73-5 VNR Co. NY
LINKS
K. S. Brown, The Factorial Number System
EXAMPLE
Determining a(2238): 720 = 6! < 2238 <= 7! = 5040; 2238 = 3*6! + 78; 78 = 3*4! + 6; 6 = 2*2! + 2 (to take 6 = 1*3! is not allowed since then condition d_0 = 1 cannot be met); 2 = 1*1! + 1*0!, so 2238 = 3*6! + 0*5! + 3*4! + 0*3! + 2*2! +
1*1! + 1*0! and a(2238) = 3030211.
PROG
(PARI) {for(n=1, 40, k=n-1; j=1; p=1; w=[]; while(p<=k, w=concat(p, w); j++; p=p*j); v="0"; for(i=1, length(w), d=divrem(k, w[i]); v=concat(v, d[1]); k=d[2]); print1(eval(concat(v, 1)), ", "))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Lekraj Beedassy, Jun 18 2002
EXTENSIONS
Edited by Klaus Brockhaus, Jun 10 2003, Jun 14 2003
STATUS
approved