Dear Uncle Colin,

If you know all of the factors of $n$, can you use that to find all of the factors of $n^2$? For example, I know that 6 has factors 1, 2, 3 and 6. Its square, 36, has the same factors, as well as 4, 9, 12, 18 and 36, but I don’t see an easy way to find them all — just squaring the original factors misses 12 and 18, and looping over all of the possibilities seems inefficient, especially for larger numbers.

– Something Quite Upsetting About Recursively Enumerating Divisors

Hi, SQUARED – and thank you for your message!

Sadly, I don’t think there’s a quick and simple…

Continue reading at:

http://ift.tt/2tgsfAr

### Like this:

Like Loading...

*Related*