Let
n=2^10 3^7 5^4…31^2…59^2 61…97
be the factorization of an integer such that the powers of primes are non-increasing.
I would like to write a code in Mathematica to find Min and Max of prime factor of n such that they have the same power.
for example I want a function which take r(the power) and give (at most two) primes in general. A specific answer for the above sample is
minwithpower[7]=3
maxwithpower[7]=3
minwithpower[2]=31
maxwithpower[2]=59
Any idea please.
Let
n = 91065388654697452410240000thenreturns
and the expression
returns only those elements from the list of factors and coefficients where the coefficient is
2, ieNext, the expression
returns
Note that this approach fails if the power you are interested in only occurs once in the output from FactorInteger, for example
returns
but you should be able to fix that deficiency quite easily.