Author |
Message |
Prince
![](http://www.angelfire.com/hiphop3/m-unit_hustla/images/fxckpare.jpg)
|
Posted: Thu Feb 12, 2004 10:33 am Post subject: perfect numbers... |
|
|
i kno this is easy (mayb its jus my laziness) does sumone kno of a simple way to find perfect numbers? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
Prince
![](http://www.angelfire.com/hiphop3/m-unit_hustla/images/fxckpare.jpg)
|
Posted: Thu Feb 12, 2004 10:40 am Post subject: (No subject) |
|
|
a number thats equal to the sum of its proper factors is a perfect number |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Feb 12, 2004 10:42 am Post subject: (No subject) |
|
|
hmm... forloop factors and see if they make up a perfect number ![Laughing Laughing](http://compsci.ca/v3/images/smiles/icon_lol.gif) |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Prince
![](http://www.angelfire.com/hiphop3/m-unit_hustla/images/fxckpare.jpg)
|
Posted: Thu Feb 12, 2004 10:59 am Post subject: (No subject) |
|
|
lol umm could u explain that a bit ![Confused Confused](http://compsci.ca/v3/images/smiles/icon_confused.gif) |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Thu Feb 12, 2004 3:17 pm Post subject: (No subject) |
|
|
http://mathforum.org/dr.math/faq/faq.perfect.html
And quickly, the Quick BASIC program in the above page for finding Mersenne primes and their associated perfect numbers:
code: | DEFDBL A-Y: DEFSTR Z: CLS
mer = 1: two# = 1: power = 1: xm = y: x2 = y
1 power = power + 1: mer = mer + mer + 1: two# = two# + two#
LOCATE 25, 1: PRINT "Testing"; mer;
FOR i = 3 TO INT(SQR(mer + 1)) STEP 2: IF (mer MOD i) = 0 THEN 1
NEXT
LOCATE 24, 1: PRINT USING "#,###########"; mer;
PRINT " = 2^"; LTRIM$(STR$(power)); "-1";
IF power < 31 THEN
PRINT TAB(36); USING "###,###########"; two# * mer;
ELSE PRINT TAB(26); "2,305,843,008,139,952,128";
END IF
PRINT " = (2^"; LTRIM$(STR$(power)); "-1) * 2^"; LTRIM$(STR$(power - 1))
IF power < 31 THEN 1 |
|
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
Posted: Thu Feb 12, 2004 5:10 pm Post subject: (No subject) |
|
|
um, anyways... google prime numbers you'll find a bunch of stuff.
its something like 2(n^2) (2n^2) where (2n^2) is a prime... dunno, kinda confusing.. google it though, you'll find a much better explanation ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
Posted: Fri May 06, 2005 5:56 pm Post subject: (No subject) |
|
|
Tony wrote: well I'm not too sure on the "proper factors" part
Yes they are only proper factors. |
|
|
|
|
![](images/spacer.gif) |
|