OFFSET
0,4
COMMENTS
See A299160 for the corresponding denominators.
The function f restricted to the nonnegative integers establishes a bijection from the nonnegative integers to the rational numbers q such that 0 <= q < 1, hence n -> a(n) / A299161(n) runs uniquely through all rational numbers q such that 0 <= q < 1.
The rational numbers q = n + f(n) for some integer n are the fixed points of f.
If two rational numbers, say p and q, have the same sign and can be added without carry in factorial base, then f(p + q) = f(p) + f(q).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Rémy Sigrist, Colored logarithmic scatterplot of the first 100000 terms (where the color is function of A299160(n))
Wikipedia, Factorial number system (Fractional values)
FORMULA
a(n) < A299160(n) for any n >= 0.
a(n!) = 1 for any n >= 0.
EXAMPLE
The first terms, alongside f(n) and the factorial base representations of n and of f(n), are:
n a(n) f(n) fact(n) fact(f(n))
-- ---- ---- ------- ----------
0 0 0 0 0.0
1 1 1/2 1 0.1
2 1 1/6 1 0 0.0 1
3 2 2/3 1 1 0.1 1
4 1 1/3 2 0 0.0 2
5 5 5/6 2 1 0.1 2
6 1 1/24 1 0 0 0.0 0 1
7 13 13/24 1 0 1 0.1 0 1
8 5 5/24 1 1 0 0.0 1 1
9 17 17/24 1 1 1 0.1 1 1
10 3 3/8 1 2 0 0.0 2 1
11 7 7/8 1 2 1 0.1 2 1
12 1 1/12 2 0 0 0.0 0 2
13 7 7/12 2 0 1 0.1 0 2
14 1 1/4 2 1 0 0.0 1 2
15 3 3/4 2 1 1 0.1 1 2
16 5 5/12 2 2 0 0.0 2 2
17 11 11/12 2 2 1 0.1 2 2
18 1 1/8 3 0 0 0.0 0 3
19 5 5/8 3 0 1 0.1 0 3
20 7 7/24 3 1 0 0.0 1 3
MATHEMATICA
Block[{nn = 72, m}, m = 1; While[Factorial@ m < nn, m++]; m; {0}~Join~Numerator@ Array[NumberCompose[Prepend[#, 0], 1/Range[Length@ # + 1]!] &@Reverse@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, nn]] (* Michael De Vlieger, Feb 10 2018 *)
PROG
(PARI) a(n) = my (v=0); for (r=2, oo, if (n==0, return (numerator(v))); v += (n%r)/r!; n\=r)
CROSSREFS
KEYWORD
nonn,base,frac
AUTHOR
Rémy Sigrist, Feb 04 2018
STATUS
approved