login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A289508
a(n) is the GCD of the indices j for which the j-th prime p_j divides n.
104
0, 1, 2, 1, 3, 1, 4, 1, 2, 1, 5, 1, 6, 1, 1, 1, 7, 1, 8, 1, 2, 1, 9, 1, 3, 1, 2, 1, 10, 1, 11, 1, 1, 1, 1, 1, 12, 1, 2, 1, 13, 1, 14, 1, 1, 1, 15, 1, 4, 1, 1, 1, 16, 1, 1, 1, 2, 1, 17, 1, 18, 1, 2, 1, 3, 1, 19, 1, 1, 1, 20, 1, 21, 1, 1, 1, 1, 1, 22, 1, 2, 1, 23
OFFSET
1,3
COMMENTS
The number n = Product_j p_j can be regarded as an index for the multiset of all the j's, occurring with multiplicity corresponding to the highest power of p_j dividing n. Then a(n) is the gcd of the elements of this multiset. Compare A056239, where the same encoding for integer multisets('Heinz encoding') is used, but where A056239(n) is the sum, rather than the gcd, of the elements of the corresponding multiset (partition) of the j's. Cf. also A003963, for which A003963(n) is the product of the elements of the corresponding multiset.
a(m*n) = gcd(a(m),a(n)). - Robert Israel, Jul 19 2017
LINKS
FORMULA
a(n) = gcd_j j, where p_j divides n.
a(n) = A289506(n)/A289507(n).
EXAMPLE
a(n) = 1 for all even n as 2 = p_1. Also a(p_j) = j.
Further, a(703) = 4 because 703 = p_8.p_{12} and gcd(8,12) = 4.
MAPLE
f:= n -> igcd(op(map(numtheory:-pi, numtheory:-factorset(n)))):
map(f, [$1..100]); # Robert Israel, Jul 19 2017
MATHEMATICA
Table[GCD @@ Map[PrimePi, FactorInteger[n][[All, 1]] ], {n, 2, 83}] (* Michael De Vlieger, Jul 19 2017 *)
PROG
(PARI) a(n) = my(f=factor(n)); gcd(apply(x->primepi(x), f[, 1])); \\ Michel Marcus, Jul 19 2017
(Python)
from sympy import primefactors, primepi, gcd
def a(n):
return gcd([primepi(d) for d in primefactors(n)])
print([a(n) for n in range(2, 101)]) # Indranil Ghosh, Jul 20 2017
CROSSREFS
Sequence in context: A280504 A087267 A128267 * A364448 A028920 A376566
KEYWORD
easy,nonn
AUTHOR
STATUS
approved