Found the code on the web. Should be simple to convert to B4A. Have not checked if B4A code will be faster (although I guess it will be pretty much the same). I am watching my device and see that it has only got to 360 000 in about an hour....Sounds interesting, but why inline Java? Does it make it faster?
I'm using B4A 4.00, so no Java for me...
I'll be upgrading soon, though.
No Ilan. You need to get all the integer factors of the number and add them together. If they total to the number itself then the number is a perfect number. Take 28 for eg:hi johan
I am not sure I have understood what is a perfect number
what I understood is you take the number and try to see if the numbers lower then the number together will become the number...
like 6 = 1 + 2 + 3 then 6 is a perfect number
so you can just calculate 1+2+3+4+5+6+7+8+9+10+11+12+13..... and the result is also a perfect number right? why calculate from the end and try to see if its a perfect number calculate from the beginning ...
or am I wrong??
I will see if i can find the biggest perfect number
Here is a piece of code that I found that spits out the first 13 perfect numbers in probably a minute or so. Note that the 13th perfect number has 314 digits. It looks like this:I hope you have a few decades left to keep the app running
I have just for fun started looking for the first 20 with the project in post #10. Starting time was 18:30:16 local time. It is now 20:13 and it is still thinking about this one. It has 2663 digits and was discovered in 1961 by some guy with the surname of Hurwitz.I guess we'll need a big cluster of 32+ cores servers to speed it up a little
When I left this morning at 04h30 "old faithful" was still crunching the numbers to try and find the first 23. Left it on to run while I am away from home today and will check tonight when I get home around 21h00.Looking for the first 23 perfect numbers. Starting time is 20:47:09. Will see if it managed to crunch it out by 04h30 tomorrow morning. I have all faith in my Samsumg tablet to be able to do so....
Back home. No sign of a pile of molten plastic. Still running. See task manager indicates that the CPU is idling along at about 50% - which is actually P*&^%! me off because it could have been twice as far as what it is at present if it pulled its weight today while I was away. And to think it basically sat here on my desk in idle mode all day long and was happily chewing away on the electricity that I have to pay for while doing nothing? This is not on! I am going to fetch a hammer and threaten this lazy CPU to start working at full pace right now...really, 50% is being extremely lazy...No wonder there is not a pile of molten plastic on my desk. 50% with no answer - unacceptable. Molten plastic with an answer in the log - priceless!Have you prepared yourself to coming home to a pile of molten plastic?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?