FactorInteger
can be used to perform prime factorization:
FactorInteger[5^2 7^3 11^4]
Results in:
{{5,2},{7,3},{11,4}}
Is there a function that given an integer will return the value of a given prime factor raised to its power?
E.g. let's say the function is F
:
F[5^2 7^3 11^4, 5] returns: 5^2
F[5^2 7^3 11^4, 7] returns: 7^3
F[5^2 7^3 11^4, 11] returns: 11^4
Also, is there a function that will return the power of a given prime?
E.g. let's say the function is G
:
G[5^2 7^3 11^4, 5] returns: 2
G[5^2 7^3 11^4, 7] returns: 3
G[5^2 7^3 11^4, 11] returns: 4