A289815 The first of a pair of coprime numbers whose factorizations depend on the ternary representation of n (see Comments for precise definition).
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, 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, 1, 3, 6, 3, 1, 2, 1, 4, 10, 5, 12, 30, 15, 4, 10, 5, 1, 2, 1, 3, 6
Offset: 0
Examples
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.
Links
Programs
-
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
Comments