{-

  Some ideas:
  - https://en.wikipedia.org/wiki/Sociable_number
  - https://en.wikipedia.org/wiki/Aliquot_sequence

  Since we want to find chains of values formed by Aliquot sequence,
  we can first compute (x, sumOfProperDivisors x) for all values in the search space,
  then we restrict keys by collecting all values of `sumOfProperDivisors` (cutting),
  and doing this repeatly will eventually get us to a point
  that all remaining values of this map is in some cycle and no more cutting
  can be made.

  Fortunately with 20 seconds, only 117 pairs are remaining,
  which is far more managable to search through.

  Update: since we are working with a larget number of values,
  whose sum of proper divisors are all needed, we can avoid
  dealing with each individual ones and just work with an vector to
  sort it out - it's actually way faster.

  TODO: we don't really need multiple rounds of reduction to get to the
  "cycle nodes only" point - the vector should be fast enough to deal with.

 -}

maxN :: Int
maxN = 1000000
maxN :: Int
maxN = 1000000
maxN = 1000000