Jump to content

Talk:Perfect number/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2

I think the Odd Cubes section could be made more accurate

For odd cubes to work they only seem to work for every second even perfect number, I don't think the article makes that clear, unless I'm miss reading the explanation ( which I may be but since I didn't quite understand it maybe it could be made clearer):

In [3385]: def ffs(x):
     ...:   x = gmpy2.mpz(x)
     ...:   return gmpy2.bit_length(x&-x)-1


     ...: def extractoddfactor(N):
     ...:   return N//(2**ffs(N))


In [3385]: def checkifperfectnum(N):
     ...:    a = ffs(N)
     ...:    e = extractoddfactor(N)
     ...:    ex = 2**(a+1)-1
     ...:    if e == ex: return True
     ...:    else: return False
In [3383]: a = pow(1, 3)
     ...: for x in range (3,8192,2):
     ...:    a += pow(x,3)
     ...:    b = extractoddfactor(a)
     ...:    if checkifperfectnum(a):
     ...:         print (a,b, gmpy2.is_prime(b), checkifperfectnum(a))
     ...: 
     ...: 

Answer:

28 7 True True
496 31 True True
8128 127 True True
130816 511 False True
2096128 2047 False True
33550336 8191 True True
536854528 32767 False True
8589869056 131071 True True
137438691328 524287 True True
2199022206976 2097151 False True
35184367894528 8388607 False True
562949936644096 33554431 False True

you'll see the 15, 63, 1023, etc do not work with the odd cube method.

So every second odd number n in the form of (2**(n-1)*(2**n-1) is true for this equation (making 6 being the exception). This would obviously include every even perfect number that is a Mersenne prime. While stating every Centered nonagonal number is true, this could be expanded to the exact statement statement at the beginning of this paragraph.

So I think what I'm saying is that there is an expanded, more accurate statement to be made of the odd cube method, that doesn't require it to be tested if it's a centered nonagonal number since every odd n is a centered nonagonal number. This can be verified via:

climb=1*4-1
loop:
  n=((3*climb-2)*(3*climb-1))//2
  climb=climb*4-1

The Centered nonagonal number wiki doesn't mention that it includes every odd n in the form of (2**(n-1)*(2**n-1) either so I don't think anyone would come to that determination without doing the math. I'm not sure why it's not mentioned, unless there is no published proof of it, maybe?

LeagueEnthusiast (talk) 05:08, 6 May 2022 (UTC)LeagueEnthusiast