|We don't bite newbies here... much|
Weird number generatorby jimt (Chaplain)
|on Oct 23, 2006 at 15:53 UTC||Need Help??|
So, I was off hunting for another obfuscation/golfing challenge for myself and was thinking about writing up an abundant number generator (I'd discovered an old app I'd done as a wee college student in pascal for my CS 112 class), but considered it too simple a task. A little digging around yielded weird numbers, which are, of course, abundant numbers which are not semi-perfect.
So now I give you, in only 176 characters, a weird number generator.
Note that with only small modifications, this script can also easily print out deficient numbers, abundant numbers, perfect numbers, semi-perfect numbers, multiply perfect numbers, and who knows how many other variations on the theme. A more interested party may try stepping in to upgrade this program to print out this information (6 P, 10 D, 12 A, 20 S, 70 W, 120 3P, and so on) for all numbers it encounters.
Update: Shaved off a character.
Update 2: Shaved off 10 more characters.
Update 3: Shaved off another 13 characters. Obviously, this wasn't as golfed as I'd originally thought. Wow.
Update 4: Added in another example, explaining Limbic~Region's example set below