
ASM to test Perfect Number
Quote:
> Any one knows how to test perfect numbers and prime numbers using ASM
> program ?
You should decide what method you want to use first and then attack
the question of how to do it in ASM. The method question is a number
theory question, not a programming question and certainly not an ASM
question, so there are much better places to ask.
I assume you are looking for even perfect numbers (odd perfect
numbers probably don't exist, though that hasn't been proven).
If you don't know yet, an even perfect number is any number:
(In C-like notation)
( 1 << (P - 1) ) * ( (1 << P) - 1)
where ( (1 << P) - 1 ) is prime. (P also must be prime, or (1<<P)-1
couldn't be prime).
Some very powerful methods have been invented for testing whether
(1<<P)-1 is prime. Straight forward methods, like testing all
possible divisors up to the square root, are useless once P is
large enough to be interesting.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/