OFFSET
0,3
COMMENTS
The encoding used here is related to that used for the Doudna sequence (A005940):
- for any pair (u, v) of coprime positive integers, the ternary expansion of the unique n >= 0 such that T(n, 1) = u and T(n, 2) = v is built as follows (from right to left):
- for m = 1, 2, ..., let p be the m-th prime number,
- if p neither divides u nor v then we add a 0,
- if p divides u with multiplicity e then we add a run of e 1's,
- if p divides v with multiplicity e then we add a run of e 2's,
- we also insert an extra 0 between pairs of runs of 1's not separated by 2's and between pairs of runs of 2's not separated by 1's.
This encoding can be applied to any fixed base b >= 2 and will yield a bijection from the nonnegative integers to the set of tuples of b-1 pairwise coprime positive integers.
The case b = 2 corresponds (up to the offset) to the Doudna sequence (A005940).
The sequence n -> T(n, 1) / T(n, 2) runs through all the reduced positive rationals exactly once.
FORMULA
T(n, 1) = 1 iff n belongs to A005823.
T(n, 2) = 1 iff n belongs to A005836.
T(A004488(n), 1) = T(n, 2).
T(A004488(n), 2) = T(n, 1).
T((3^e - 1)/2, 1) = 2^e for any e >= 0.
T(3^e - 1, 2) = 2^e for any e >= 0.
T(3^e, 1) = A000040(e + 1) for any e >= 0.
T(2 * 3^e, 2) = A000040(e + 1) for any e >= 0.
T(3*n, k) = A003961(T(n, k)).
EXAMPLE
Triangle T(n, k) begins (alongside the ternary expansion of n):
n n-th row ter(n)
-- -------- ------
0 [1, 1] 0
1 [2, 1] 1
2 [1, 2] 2
3 [3, 1] 10
4 [4, 1] 11
5 [3, 2] 12
6 [1, 3] 20
7 [2, 3] 21
8 [1, 4] 22
9 [5, 1] 100
10 [6, 1] 101
11 [5, 2] 102
12 [9, 1] 110
13 [8, 1] 111
14 [9, 2] 112
15 [5, 3] 120
16 [10, 3] 121
17 [3, 4] 122
PROG
(PARI) row(n, b = 3) = { my (r = vector(b-1, d, 1), g = 0, t = 0); while (n, my (d = n % b); n \= b; g++; if (d, my (e = 1); while (n % b == d, e++; n \= b; ); if (t==d, g--, t = d); r[d] *= prime(g)^e; ); ); return (r); }
CROSSREFS
KEYWORD
nonn,base,tabf
AUTHOR
Rémy Sigrist, Oct 07 2023
STATUS
approved