Project Euler 561 - Divisor Pairs

Official link:

Thought Process

This was a really fun problem, heavily leaning towards the mathematics side. First thing I did, as usual, is make a brute force solution to find S((pm#)^n) which lead to the following OEIS sequences listed below:,, and 

It was quite a fun challenge in itself to prove this statement. For those who are interested enjoy the math.

Now, let's get back into the meat of the problem

The next 2 cases are less important

And the final important case

Really enjoyed this step by step process!

Finally, some additional details for those interested on 1d), e) and 2d), e) as to why these formulas are true. Read the wiki pages to find the proofs of important property 1 and 2 listed below

Interactive Code

Input an Integer (yourinput)

Code will output Q(yourinput)