login
A299020
a(n) is the maximum digit in the factorial base expansion of 1/n.
4
1, 1, 2, 2, 4, 1, 6, 3, 3, 2, 10, 2, 12, 3, 3, 3, 16, 4, 18, 1, 4, 6, 22, 1, 7, 9, 5, 5, 28, 4, 30, 4, 7, 9, 4, 3, 36, 13, 8, 3, 40, 5, 42, 8, 4, 15, 46, 3, 11, 6, 12, 9, 52, 6, 8, 6, 15, 15, 58, 2, 60, 22, 5, 6, 7, 9, 66, 12, 17, 4, 70, 4, 72, 31, 5, 14, 7
OFFSET
1,3
COMMENTS
See the Wikipedia link for the construction method of 1/n in factorial base.
FORMULA
a(n!) = 1 for any n >= 0.
a(n! / k) = k for any n > 1 and k = 1..n-1.
a(p) = p - 1 for any prime p.
EXAMPLE
The first terms, alongside 1/n in factorial base, are:
n a(n) 1/n in factorial base
-- ---- ---------------------
1 1 1
2 1 0.1
3 2 0.0 2
4 2 0.0 1 2
5 4 0.0 1 0 4
6 1 0.0 1
7 6 0.0 0 3 2 0 6
8 3 0.0 0 3
9 3 0.0 0 2 3 2
10 2 0.0 0 2 2
11 10 0.0 0 2 0 5 3 1 4 0 10
12 2 0.0 0 2
13 12 0.0 0 1 4 1 2 5 4 8 5 0 12
14 3 0.0 0 1 3 3 3
15 3 0.0 0 1 3
16 3 0.0 0 1 2 3
17 16 0.0 0 1 2 0 2 3 6 8 9 0 9 2 7 0 16
18 4 0.0 0 1 1 4
19 18 0.0 0 1 1 1 6 2 0 9 5 2 6 11 11 13 8 0 18
20 1 0.0 0 1 1
MATHEMATICA
a[n_] := Module[{m = 0, r = 1, f = 1/n}, While[f > 0, m = Max[m, Floor[f]]; r++; f = FractionalPart[f]*r]; m]; Array[a, 77] (* Jean-François Alcover, Feb 05 2018, translated from PARI *)
PROG
(PARI) a(n) = my (m=0, r=1, f=1/n); while (f>0, m = max(m, floor(f)); r++; f = frac(f)*r); return (m)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 31 2018
STATUS
approved