A381954 The maximum exponent in the prime factorization of n that is coprime to n, or 0 if no such exponent exists.
0, 1, 1, 0, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 5, 1, 1, 1, 0, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1
Offset: 1
Examples
a(2) = 1 since 2 = 2^1 and 1 is coprime to 2. a(4) = 0 since 4 = 2^2 and the exponent 2 is not coprime to 4. a(12) = 1 since 12 = 2^2 * 3^1, the exponent 2 is not coprime to 12, and the exponent 1 is coprime to 12.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := If[(s = Select[FactorInteger[n][[;; , 2]], CoprimeQ[#, n] &]) != {}, Max[s], 0]; a[1] = 0; Array[a, 100]
-
PARI
a(n) = {my(e = factor(n)[, 2], s = select(x -> if(gcd(x, n) == 1, x, 0), e)); if(#s == 0, 0, vecmax(s));}
Comments