login
A269317
Ternary version of A257341: take the proper fractions in lowest terms in ascending order by denominators and within each denominator in ascending order by numerators. a(n) is the n-th ternary digit of the n-th fraction.
0
1, 0, 0, 2, 2, 1, 1, 0, 2, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 1, 0, 2, 0, 2, 2, 0, 0, 1, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 2, 1, 2, 1, 1, 1, 2, 2, 2, 0, 1, 1, 1, 1, 2, 0, 2, 2, 0, 2, 1, 1, 1, 0, 1, 0, 2, 1, 0
OFFSET
1,4
MATHEMATICA
FractionList[n_] := Module[
{i, j, A},
A = Union[Flatten[Table[j/i, {i, 1, n}, {j, 1, i}]]];
Sort[A,
Denominator[#1] <
Denominator[#2] || (Denominator[#1] ==
Denominator[#2] && #1 < #2) &]
];
DiagDigits[n_, b_] := Module[
{A, B, d},
A = Drop[FractionList[n], 1];
d = Table[RealDigits[A[[i]], b, n, -1][[1, i]], {i, 1, n}]
];
DiagDigits[86, 3]
CROSSREFS
KEYWORD
nonn,cons
AUTHOR
Peter Karpov, Feb 23 2016
STATUS
approved