login
a(n) is the maximum digit in the factorial base expansion of 1/n.
4

%I #17 Feb 05 2018 17:09:35

%S 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,

%T 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,

%U 2,60,22,5,6,7,9,66,12,17,4,70,4,72,31,5,14,7

%N a(n) is the maximum digit in the factorial base expansion of 1/n.

%C See the Wikipedia link for the construction method of 1/n in factorial base.

%H Rémy Sigrist, <a href="/A299020/b299020.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A299020/a299020.png">Colored scatterplot of the first 25000 terms</a> (where the color is function of A052126(n))

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Factorial_number_system#Fractional_values">Factorial number system (Fractional values)</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>

%F a(n!) = 1 for any n >= 0.

%F a(n! / k) = k for any n > 1 and k = 1..n-1.

%F a(p) = p - 1 for any prime p.

%e The first terms, alongside 1/n in factorial base, are:

%e n a(n) 1/n in factorial base

%e -- ---- ---------------------

%e 1 1 1

%e 2 1 0.1

%e 3 2 0.0 2

%e 4 2 0.0 1 2

%e 5 4 0.0 1 0 4

%e 6 1 0.0 1

%e 7 6 0.0 0 3 2 0 6

%e 8 3 0.0 0 3

%e 9 3 0.0 0 2 3 2

%e 10 2 0.0 0 2 2

%e 11 10 0.0 0 2 0 5 3 1 4 0 10

%e 12 2 0.0 0 2

%e 13 12 0.0 0 1 4 1 2 5 4 8 5 0 12

%e 14 3 0.0 0 1 3 3 3

%e 15 3 0.0 0 1 3

%e 16 3 0.0 0 1 2 3

%e 17 16 0.0 0 1 2 0 2 3 6 8 9 0 9 2 7 0 16

%e 18 4 0.0 0 1 1 4

%e 19 18 0.0 0 1 1 1 6 2 0 9 5 2 6 11 11 13 8 0 18

%e 20 1 0.0 0 1 1

%t 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 *)

%o (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)

%Y Cf. A052126, A246359, A276350.

%K nonn,base

%O 1,3

%A _Rémy Sigrist_, Jan 31 2018