A301652 Triangle read by rows: row n gives the digits of n in factorial base in reversed order.
0, 1, 0, 1, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 2, 1, 1, 2, 1, 0, 0, 2, 1, 0, 2, 0, 1, 2, 1, 1, 2, 0, 2, 2, 1, 2, 2, 0, 0, 3, 1, 0, 3, 0, 1, 3, 1, 1, 3, 0, 2, 3, 1, 2, 3, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 2, 0, 1, 1, 2, 0, 1, 0, 0, 1, 1
Offset: 0
Examples
n | 1 2 6 ---+--------- 0 | 0; 1 | 1; 2 | 0, 1; 3 | 1, 1; 4 | 0, 2; 5 | 1, 2; 6 | 0, 0, 1; 7 | 1, 0, 1; 8 | 0, 1, 1; 9 | 1, 1, 1; 10 | 0, 2, 1; 11 | 1, 2, 1; 12 | 0, 0, 2; 13 | 1, 0, 2; 14 | 0, 1, 2; 15 | 1, 1, 2; 16 | 0, 2, 2; 17 | 1, 2, 2; 18 | 0, 0, 3; 19 | 1, 0, 3;
Links
- Seiichi Manyama, Rows n = 0..2000, flattened
- Wikipedia, Factorial number system.
- Index entries for sequences related to factorial base representation.
Crossrefs
Programs
-
Mathematica
row[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, AppendTo[s, r]; m++]; s]; row[0] = {0}; Array[row, 31, 0] // Flatten (* Amiram Eldar, Mar 11 2024 *)
-
Sage
terms=25; print([0]+[x for sublist in [[floor(n/factorial(i))%(i+1) for i in [k for k in [1..n] if factorial(k)<=n]] for n in [1..terms]] for x in sublist]) # Tom Edgar, Aug 15 2018
Formula
T(n,k) = floor(n/k!) mod k+1. - Tom Edgar, Aug 15 2018
Comments