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.

A289815 The first of a pair of coprime numbers whose factorizations depend on the ternary representation of n (see Comments for precise definition).

This page as a plain text file.
%I A289815 #44 Apr 21 2021 07:12:05
%S A289815 1,2,1,3,6,3,1,2,1,4,10,5,12,30,15,4,10,5,1,2,1,3,6,3,1,2,1,5,14,7,15,
%T A289815 42,21,5,14,7,20,70,35,60,210,105,20,70,35,5,14,7,15,42,21,5,14,7,1,2,
%U A289815 1,3,6,3,1,2,1,4,10,5,12,30,15,4,10,5,1,2,1,3,6
%N A289815 The first of a pair of coprime numbers whose factorizations depend on the ternary representation of n (see Comments for precise definition).
%C A289815 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):
%C A289815 - let S(0) = A000961 \ { 1 },
%C A289815 - 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,
%C A289815 - then a(n) = Product_{i=1..k such that t_i=1} "the (e_i+1)-th term of S(k)".
%C A289815 See A289816 for the second coprime number.
%C A289815 See A289838 for the product of this sequence with A289816.
%C A289815 By design, gcd(a(n), A289816(n)) = 1.
%C A289815 Also, the number of distinct prime factors of a(n) equals the number of ones in the ternary representation of n.
%C A289815 We also have a(n) = A289816(A004488(n)) for any n >= 0.
%C A289815 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).
%C A289815 This sequence combines features of A289813 and A289272.
%C A289815 The scatterplot of the first terms of this sequence vs A289816 (both with logarithmic scaling) looks like a triangular cristal.
%C A289815 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).
%H A289815 Rémy Sigrist, <a href="/A289815/b289815.txt">Table of n, a(n) for n = 0..10000</a>
%H A289815 Rémy Sigrist, <a href="/A289815/a289815.png">Scatterplot of the first 10000 terms of A289815 vs A289816 (both with logarithmic scaling)</a>
%H A289815 Rémy Sigrist, <a href="/A289815/a289815.gp.txt">PARI program to uniquely enumerate tuples of mutually coprime numbers</a>
%F A289815 a(A005836(n)) = A289272(n-1) for any n > 0.
%F A289815 a(2 * A005836(n)) = 1 for any n > 0.
%e A289815 For n=42:
%e A289815 - 42 = 2*3^1 + 1*3^2 + 1*3^3,
%e A289815 - S(0) = { 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, ... },
%e A289815 - S(1) = S(0) \ { 3^(1+j) with j > 0 }
%e A289815        = { 2, 3, 4, 5, 7, 8,    11, 13, 16, 17, 19, 23, 25,     29, ... },
%e A289815 - S(2) = S(1) \ { 2^(2+j) with j > 0 }
%e A289815        = { 2, 3, 4, 5, 7,       11, 13,     17, 19, 23, 25,     29, ... },
%e A289815 - S(3) = S(2) \ { 5^(1+j) with j > 0 }
%e A289815        = { 2, 3, 4, 5, 7,       11, 13,     17, 19, 23,         29, ... },
%e A289815 - a(42) = 4 * 5 = 20.
%o A289815 (PARI) a(n) =
%o A289815 {
%o A289815     my (v=1, x=1);
%o A289815     for (o=2, oo,
%o A289815         if (n==0, return (v));
%o A289815         if (gcd(x,o)==1 && omega(o)==1,
%o A289815             if (n % 3,    x *= o);
%o A289815             if (n % 3==1, v *= o);
%o A289815             n \= 3;
%o A289815         );
%o A289815     );
%o A289815 }
%o A289815 (Python)
%o A289815 from sympy import gcd, primefactors
%o A289815 def omega(n): return 0 if n==1 else len(primefactors(n))
%o A289815 def a(n):
%o A289815     v, x, o = 1, 1, 2
%o A289815     while True:
%o A289815         if n==0: return v
%o A289815         if gcd(x, o)==1 and omega(o)==1:
%o A289815             if n%3: x*=o
%o A289815             if n%3==1:v*=o
%o A289815             n //= 3
%o A289815         o+=1
%o A289815 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Aug 02 2017
%Y A289815 Cf. A000961, A004488, A289272, A289813, A289816, A289838, A289905.
%K A289815 nonn,base,look
%O A289815 0,2
%A A289815 _Rémy Sigrist_, Jul 12 2017