2

As stated in an answer here, there is no easy algorithm for computing the radical of an integer. My question is whether or not there is an efficient algorithm to computer whether or not the radical of a number is any value, for my purpose, $10$. Let's call the integer $n$.

Initially I thought of iteratively checking if it is divisible by all prime factors of $10$, then dividing $n$ by the prime factors of $10$ until it is no longer possible, checking whether or not the resulting number is $1$. This works with $10$, but not any number where the radical of this number is not the number itself.

Then I thought of iterating through primes up to $\sqrt{n}$, checking if it is divisible by all and only the prime factors of $10$. This also does not work with numbers where the radical is not itself. For my purpose this is a minor inconvenience, but can be dealt with. A more general answer would be preferable if similarly efficient.

TL;DR: How does one calculate whether the radical of $n$ is equal to $m$ ($10$ in my case) efficiently?

Robinson
  • 121
  • Radical of $10$ must end in a $0$ ... If the number doesn't then it's false. – Roddy MacPhee Oct 09 '21 at 10:40
  • @RoddyMacPhee however that doesn't determine truth. For example the radical of $170$ is $170$, as the prime factorisation of $170$ is $2517$. – Robinson Oct 09 '21 at 10:51
  • Right but it does lend to an easy first condition. The number without the last digit should have radical $2, 5, 10$ – Roddy MacPhee Oct 09 '21 at 11:40
  • Or in general any non unitary divisor of the suspected radical. – Roddy MacPhee Oct 09 '21 at 11:55
  • What's considered efficient (you currently have a logarithmic algorithm after factorization of $m$, and if done correctly it works). – Roddy MacPhee Oct 09 '21 at 21:36
  • In general, there is probably no efficient algorithm. If we have the special case $n=m$, then $rad(n)=m$ holds if and only if $m$ is squarefree and no efficient method is known to decide that. – Peter Oct 12 '21 at 12:22
  • If we however know that $m$ is squarefree (which is a necessary condition anyway), then there is an efficient method. Repeatedly divide $n$ by $\gcd(m,n)$ until $\gcd(m,n)=1$. If and only if the final value for $n$ is $1$ , we have $rad(n)=m$. – Peter Oct 12 '21 at 12:23
  • If we know the prime factors of $m$ (like in your special case), then there is an even easier calculation : For every prime $p\mid m$ , divide $n$ by $p$ as long as $p\mid n$. If and only if the final result is $1$, we have $rad(n)=m$. – Peter Oct 12 '21 at 12:29

0 Answers0