Let's introduce some definitions that will be needed later.
Let prime(x)prime(x) be the set of prime divisors of xx. For example, prime(140)={2,5,7}prime(140)={2,5,7}, prime(169)={13}prime(169)={13}.
Let g(x,p)g(x,p) be the maximum possible integer pkpk where kk is an integer such that xx is divisible by pkpk. For example:
- g(45,3)=9g(45,3)=9 (4545 is divisible by 32=932=9 but not divisible by 33=2733=27),
- g(63,7)=7g(63,7)=7 (6363 is divisible by 71=771=7 but not divisible by 72=4972=49).
Let f(x,y)f(x,y) be the product of g(y,p)g(y,p) for all pp in prime(x)prime(x). For example:
- f(30,70)=g(70,2)⋅g(70,3)⋅g(70,5)=21⋅30⋅51=10f(30,70)=g(70,2)⋅g(70,3)⋅g(70,5)=21⋅30⋅51=10,
- f(525,63)=g(63,3)⋅g(63,5)⋅g(63,7)=32⋅