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.
%I A289816 #34 Apr 21 2021 07:14:08 %S A289816 1,1,2,1,1,2,3,3,6,1,1,2,1,1,2,3,3,6,4,5,10,4,5,10,12,15,30,1,1,2,1,1, %T A289816 2,3,3,6,1,1,2,1,1,2,3,3,6,4,5,10,4,5,10,12,15,30,5,7,14,5,7,14,15,21, %U A289816 42,5,7,14,5,7,14,15,21,42,20,35,70,20,35,70 %N A289816 The second of a pair of coprime numbers whose factorizations depend on the ternary representation of n (See Comments for precise definition). %C A289816 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 A289816 - let S(0) = A000961 \ { 1 }, %C A289816 - 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 A289816 - then a(n) = Product_{i=1..k such that t_i=2} "the (e_i+1)-th term of S(k)". %C A289816 See A289815 for the first coprime number and additional comments. %C A289816 The number of distinct prime factors of a(n) equals the number of twos in the ternary representation of n. %H A289816 Rémy Sigrist, <a href="/A289816/b289816.txt">Table of n, a(n) for n = 0..10000</a> %F A289816 a(n) = A289815(A004488(n)) for any n >= 0. %F A289816 a(A005836(n)) = 1 for any n > 0. %F A289816 a(2 * A005836(n)) = A289272(n-1) for any n > 0. %e A289816 For n=42: %e A289816 - 42 = 2*3^1 + 1*3^2 + 1*3^3, %e A289816 - S(0) = { 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, ... }, %e A289816 - S(1) = S(0) \ { 3^(1+j) with j > 0 } %e A289816 = { 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 23, 25, 29, ... }, %e A289816 - S(2) = S(1) \ { 2^(2+j) with j > 0 } %e A289816 = { 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 25, 29, ... }, %e A289816 - S(3) = S(2) \ { 5^(1+j) with j > 0 } %e A289816 = { 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 29, ... }, %e A289816 - a(42) = 3. %o A289816 (PARI) a(n) = my (v=1, x=1); \ %o A289816 for (o=2, oo, \ %o A289816 if (n==0, return (v)); \ %o A289816 if (gcd(x,o)==1 && omega(o)==1, \ %o A289816 if (n % 3, x *= o); \ %o A289816 if (n % 3==2, v *= o); \ %o A289816 n \= 3; \ %o A289816 ); \ %o A289816 ); %o A289816 (Python) %o A289816 from sympy import gcd, primefactors %o A289816 def omega(n): return 0 if n==1 else len(primefactors(n)) %o A289816 def a(n): %o A289816 v, x, o = 1, 1, 2 %o A289816 while True: %o A289816 if n==0: return v %o A289816 if gcd(x, o)==1 and omega(o)==1: %o A289816 if n%3: x*=o %o A289816 if n%3==2:v*=o %o A289816 n //= 3 %o A289816 o+=1 %o A289816 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Aug 02 2017 %Y A289816 Cf. A000961, A004488, A289815. %K A289816 nonn,base,look %O A289816 0,3 %A A289816 _Rémy Sigrist_, Jul 12 2017