# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a289508 Showing 1-1 of 1 %I A289508 #41 Apr 24 2020 08:12:39 %S A289508 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, %T A289508 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, %U A289508 3,1,19,1,1,1,20,1,21,1,1,1,1,1,22,1,2,1,23 %N A289508 a(n) is the GCD of the indices j for which the j-th prime p_j divides n. %C A289508 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. %C A289508 a(m*n) = gcd(a(m),a(n)). - _Robert Israel_, Jul 19 2017 %H A289508 Alois P. Heinz, Table of n, a(n) for n = 1..20000 %F A289508 a(n) = gcd_j j, where p_j divides n. %F A289508 a(n) = A289506(n)/A289507(n). %e A289508 a(n) = 1 for all even n as 2 = p_1. Also a(p_j) = j. %e A289508 Further, a(703) = 4 because 703 = p_8.p_{12} and gcd(8,12) = 4. %p A289508 f:= n -> igcd(op(map(numtheory:-pi, numtheory:-factorset(n)))): %p A289508 map(f, [$1..100]); # _Robert Israel_, Jul 19 2017 %t A289508 Table[GCD @@ Map[PrimePi, FactorInteger[n][[All, 1]] ], {n, 2, 83}] (* _Michael De Vlieger_, Jul 19 2017 *) %o A289508 (PARI) a(n) = my(f=factor(n)); gcd(apply(x->primepi(x), f[,1])); \\ _Michel Marcus_, Jul 19 2017 %o A289508 (Python) %o A289508 from sympy import primefactors, primepi, gcd %o A289508 def a(n): %o A289508 return gcd([primepi(d) for d in primefactors(n)]) %o A289508 print([a(n) for n in range(2, 101)]) # _Indranil Ghosh_, Jul 20 2017 %Y A289508 Cf. A289506, A289507. %K A289508 easy,nonn %O A289508 1,3 %A A289508 _Christopher J. Smyth_, Jul 11 2017 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE