OFFSET
0,2
COMMENTS
For n >= 0, with ternary representation Sum_{i=1..k} t_i * 3^e_i (all t_i in {1, 2} and all e_i distinct and in increasing order):
- let S(0) = A000961 \ { 1 },
- and S(i) = S(i-1) \ { p^(f + j), with p^f = the (e_i+1)-th term of S(i-1) and j > 0 } for any i=1..k,
- then a(n) = Product_{i=1..k such that t_i=1} "the (e_i+1)-th term of S(k)".
See A289816 for the second coprime number.
By design, gcd(a(n), A289816(n)) = 1.
Also, the number of distinct prime factors of a(n) equals the number of ones in the ternary representation of n.
For each pair of coprime numbers, say x and y, there is a unique index, say n, such that a(n) = x and A289816(n) = y; in fact, n = A289905(x,y).
The scatterplot of the first terms of this sequence vs A289816 (both with logarithmic scaling) looks like a triangular cristal.
For any t > 0: we can adapt the algorithm used here and in A289816 in order to uniquely enumerate every tuple of t mutually coprime numbers (see Links section for corresponding program).
LINKS
EXAMPLE
For n=42:
- 42 = 2*3^1 + 1*3^2 + 1*3^3,
- S(0) = { 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, ... },
- S(1) = S(0) \ { 3^(1+j) with j > 0 }
= { 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 23, 25, 29, ... },
- S(2) = S(1) \ { 2^(2+j) with j > 0 }
= { 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 25, 29, ... },
- S(3) = S(2) \ { 5^(1+j) with j > 0 }
= { 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 29, ... },
- a(42) = 4 * 5 = 20.
PROG
(PARI) a(n) =
{
my (v=1, x=1);
for (o=2, oo,
if (n==0, return (v));
if (gcd(x, o)==1 && omega(o)==1,
if (n % 3, x *= o);
if (n % 3==1, v *= o);
n \= 3;
);
);
}
(Python)
from sympy import gcd, primefactors
def omega(n): return 0 if n==1 else len(primefactors(n))
def a(n):
v, x, o = 1, 1, 2
while True:
if n==0: return v
if gcd(x, o)==1 and omega(o)==1:
if n%3: x*=o
if n%3==1:v*=o
n //= 3
o+=1
print([a(n) for n in range(101)]) # Indranil Ghosh, Aug 02 2017
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jul 12 2017
STATUS
approved