Removing factor $x$ from a number

69 Views Asked by At

I am required to implement this code function but I have no idea what it is asking for. Can someone explain this to me in simpler terms so that I can try to turn it into code?

Given $x$ and $y$, I need to return $Z$.

The description of the function:

If $x$ can be expressed as $x=qy^n$, then $z = q$ i.e. remove factor $y$ from the number $x$, such that $z$ no longer has $y$ as a factor.

Some example results:

x: 2835, y = 3, result = 35

x: 2357, y = 19, result = 2357

I just need a clearer idea of what they are actually asking for.

Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

The solution was to simply divide the x value as much as possible by y, and return the final divisible value.

Thank you to the kind souls for helping me out! Point noted on the formatting in future.