View Single Post
Old 2008-06-11, 13:01   #2
R.D. Silverman
R.D. Silverman's Avatar
Nov 2003

22·5·373 Posts

Originally Posted by Elhueno View Post
Hi all i was just wondering if anyone here has ever tried to calculate perfect numbers from scratch in Bloodshed softwares Dev-Pascal. i have been tasked to do this for a college teacher. any help would be appreciated. and the sooner the better.
What do you mean by "calculate perfect numbers"? Do you mean

"write a program that will find p such that 2^p-1 is prime?"

Once you have such p, then a perfect number is just (2^p-1) * 2^(p-1)
Hint: this has already been done.

Or do you mean

"given a list of such p, compute 2^(p-1) * (2^p -1)"??

If so, you must again specify what you mean by "compute".

Do you mean "calculate the decimal representation"? or "calculate the
hex representation"? or "calculate the binary representation"?? [the latter
two are trivial].
R.D. Silverman is offline   Reply With Quote