‎03-26-2010 12:38 AM
Solved! Go to Solution.
‎03-26-2010 01:48 AM
‎03-26-2010 01:57 AM
In mathematics, a perfect number is a positive integer that is the sum of its proper positive divisors, that is, the sum of the positive divisors excluding the number itself. Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself), or σ(n) = 2n.
‎03-26-2010 02:14 AM
‎03-26-2010 02:53 AM
‎03-26-2010 03:52 AM
‎03-26-2010 04:02 AM
If i understand correctly the problem is 2-fold. You'll need to make a factorization of a number, and then sum up those factors to see if it adds up to the original number, right?
So a loop, using quote and remainder to build an array of factors (the input value need to be shifted and recalculated when you find a factor), then do an array sum and compare to orignal value. Sounds about right? The Perfect numbers should ofc build an array of themselves, which is easily done in the outer/next loop.
For all number, simply do an outer loop around the whole shebang and feed it with the loop counter. If the inner test is true, add to array and you'll have an array with all perfect numbers.
/Y
‎03-26-2010 04:06 AM
Hi Sanyam,
see this link.
If you need it for a homework, then you can download the results directly. 🙂
Mike
‎03-26-2010 05:09 AM
‎03-26-2010 05:28 AM
Sanyam wrote:
Yes you are right yamadea, but sorry i am not able to develop this concept. If possible can you please provide the vi to me . I hope i am not bothering you
The best way to learn is to do it yourself. If you can tell us which bits you are having a problem with, we can help you learn. Mike has given a link to a flow diagram, Mathan a link to the description of the problem, and Yamadea has given an overview of what you would need.
Which bits are still puzzling you?