|
|
A289816
|
|
The second of a pair of coprime numbers whose factorizations depend on the ternary representation of n (See Comments for precise definition).
|
|
5
|
|
|
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, 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, 42, 5, 7, 14, 5, 7, 14, 15, 21, 42, 20, 35, 70, 20, 35, 70
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
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=2} "the (e_i+1)-th term of S(k)".
See A289815 for the first coprime number and additional comments.
The number of distinct prime factors of a(n) equals the number of twos in the ternary representation of n.
|
|
LINKS
|
Rémy Sigrist, Table of n, a(n) for n = 0..10000
|
|
FORMULA
|
a(n) = A289815(A004488(n)) for any n >= 0.
a(A005836(n)) = 1 for any n > 0.
a(2 * A005836(n)) = A289272(n-1) for any n > 0.
|
|
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) = 3.
|
|
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==2, v *= o); \
n \= 3; \
); \
);
(Python)
from sympy import floor, 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==2:v*=o
n=floor(n/3)
o+=1
print map(a, range(101)) # Indranil Ghosh, Aug 02 2017
|
|
CROSSREFS
|
Cf. A000961, A004488, A289815.
Sequence in context: A174807 A181572 A287731 * A054482 A208234 A092543
Adjacent sequences: A289813 A289814 A289815 * A289817 A289818 A289819
|
|
KEYWORD
|
nonn,base,look
|
|
AUTHOR
|
Rémy Sigrist, Jul 12 2017
|
|
STATUS
|
approved
|
|
|
|