--- from: http://rosettacode.org/wiki/Attractive_numbers