cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A366344 Irregular triangle T(n, k), n >= 0, k = 1 or 2, read by rows; the n-th row contains two coprime positive integers whose prime factorizations are encoded in the ternary expansion of n (see Comments section for precise definition).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 4, 1, 3, 2, 1, 3, 2, 3, 1, 4, 5, 1, 6, 1, 5, 2, 9, 1, 8, 1, 9, 2, 5, 3, 10, 3, 3, 4, 1, 5, 2, 5, 1, 6, 3, 5, 4, 3, 3, 10, 1, 9, 2, 9, 1, 8, 7, 1, 10, 1, 7, 2, 15, 1, 12, 1, 15, 2, 7, 3, 14, 3, 5, 4, 25, 1, 18, 1, 25, 2, 27, 1, 16, 1, 27, 2
Offset: 0

Views

Author

Rémy Sigrist, Oct 07 2023

Keywords

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.

Examples

			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
		

Crossrefs

Programs

  • 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); }

Formula

T(n, 1) = 1 iff n belongs to A005823.
T(n, 2) = 1 iff n belongs to A005836.
T(A005836(n), 1) = A005940(n+1).
T(A005823(n), 2) = A005940(n+1).
A001222(T(n, 1)) = A062756(n).
A001222(T(n, 2)) = A081603(n).
A001222(T(n, 1) * T(n, 2)) = A160384(n).
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)).