mersenneforum.org Aliquot sequences that start on the integer powers n^i
 Register FAQ Search Today's Posts Mark Forums Read

2021-03-20, 17:01   #1002
garambois

"Garambois Jean-Luc"
Oct 2011
France

3·227 Posts

Quote:
 Originally Posted by Happy5214 Please don't tell me you're trying to do anything efficient in Python. This is a job for C. You'd probably get a significant speed boost with a compiled C or C++ program with GMP compared to Python.
I do this work with the python language !
I don't know how to work on numbers of several hundred thousand digits with the C language ?
But if any of you can do this, the program must be very easy to write.
And then maybe we will find suitable exponents for bases 3, 5 or 7.
(I also launched the execution of calculations for base 7.)

Quote:
 Originally Posted by Happy5214 That's a really bad job by the translator. Are numbers considered masculine nouns in French, because I don't believe Romance languages inherited the neuter from Latin? English is a hard language to master. Many native English speakers haven't done it. It's a shame that such a complicated language has become the global lingua franca (thanks to the global hegemonic status of the British Empire and the US over the past two centuries). I would have preferred Esperanto, which was designed for the purpose.
In French, it's very different.
It has nothing to do with whether a number is masculine or feminine. We say "la moitié d'un nombre" (half of a number), because "moitié" is feminine and "le double d'un nombre" (the double of a number), because "double" is masculine !
We understand better why automatic translation is so difficult !

2021-03-20, 19:35   #1003
Happy5214

"Alexander"
Nov 2008
The Alamo City

13678 Posts

Quote:
 Originally Posted by garambois In French, it's very different. It has nothing to do with whether a number is masculine or feminine. We say "la moitié d'un nombre" (half of a number), because "moitié" is feminine and "le double d'un nombre" (the double of a number), because "double" is masculine ! We understand better why automatic translation is so difficult !
I'm so glad English got rid of grammatical gender for those reasons.

Quote:
 Originally Posted by garambois I do this work with the python language ! I don't know how to work on numbers of several hundred thousand digits with the C language ? But if any of you can do this, the program must be very easy to write. And then maybe we will find suitable exponents for bases 3, 5 or 7. (I also launched the execution of calculations for base 7.)
I went ahead and adapted aliqueit for this purpose. It's a simple C++/GMP program attached here. Compile it with:

Code:
g++ -O2 -o powerAbundance powerAbundance.cc -lgmp -lgmpxx
(I can't remember if the gmpxx is strictly needed, but I used it.) Just pass it the base and the exponent range, along with an optional skip (i.e. interval) amount. On my Kubuntu Focus laptop, it validates the abundance of 30^55440 in just under 5 seconds and the deficiency of 30^161280 in a touch over a minute.
Attached Files
 powerAbundance.tar.gz (1.4 KB, 32 views)

2021-03-20, 20:55   #1004
EdH

"Ed Hall"
Dec 2009

FBB16 Posts

Quote:
 Originally Posted by garambois I do this work with the python language ! . . .
If it isn't too much to ask, could you attach your Python script. I might like to see if I can create a C version.

Thanks!

 2021-03-20, 22:51 #1005 VBCurtis     "Curtis" Feb 2005 Riverside, CA 24×313 Posts 13^64 up through 13^70 are now C120 or bigger and can be updated. I expect to get the rest of base 13 turned orange this week. Sorry for the delay! Edit: please leave them reserved to me; I plan to get all of base 13 to 140 digits. Last fiddled with by VBCurtis on 2021-03-20 at 22:52
2021-03-21, 10:47   #1006
garambois

"Garambois Jean-Luc"
Oct 2011
France

3·227 Posts

Quote:
 Originally Posted by Happy5214 I went ahead and adapted aliqueit for this purpose. It's a simple C++/GMP program attached here. Compile it with: Code: g++ -O2 -o powerAbundance powerAbundance.cc -lgmp -lgmpxx (I can't remember if the gmpxx is strictly needed, but I used it.) Just pass it the base and the exponent range, along with an optional skip (i.e. interval) amount. On my Kubuntu Focus laptop, it validates the abundance of 30^55440 in just under 5 seconds and the deficiency of 30^161280 in a touch over a minute.

Quote:
 Originally Posted by EdH If it isn't too much to ask, could you attach your Python script. I might like to see if I can create a C version. Thanks!

I managed to get your program to work.

The abundance of 30^55440 is validated in 22 seconds on my computer with the program in C. (Very old CPU from 2011).
The validation is almost instantaneous with my python program.
For base 30, testing all even exponents from 2 to 10,000 takes 6 minutes 30 seconds with the C program and 55 seconds with my python program.

I'm sorry I don't know what's going on.
I know the C should be a lot faster.
Moreover, I cannot understand the program in C !

Please find in attached file my program in python.
I tried to comment on it to make it clearer.
I hope my comments will be enough for you ...
Attached Files
 bid_even_en.sage.tar.gz (1.4 KB, 40 views)

2021-03-21, 10:55   #1007
garambois

"Garambois Jean-Luc"
Oct 2011
France

3·227 Posts

Quote:
 Originally Posted by VBCurtis 13^64 up through 13^70 are now C120 or bigger and can be updated. I expect to get the rest of base 13 turned orange this week. Sorry for the delay! Edit: please leave them reserved to me; I plan to get all of base 13 to 140 digits.

Thank you very much !
There is really no problem with the delay : it's the same for me.
At the moment I am working on the abundance of index 1 terms of the bases with very large exponents as explained in the posts above.
And this mobilizes my CPU and I can no longer advance the calculations of the complete sequences of the project !

 2021-03-21, 12:16 #1008 yoyo     Oct 2006 Berlin, Germany 27216 Posts I take bases 58 2310 30030 510510 9699690 82589933.
2021-03-21, 12:21   #1009
Happy5214

"Alexander"
Nov 2008
The Alamo City

3·11·23 Posts

Quote:
 Originally Posted by garambois I managed to get your program to work. The abundance of 30^55440 is validated in 22 seconds on my computer with the program in C. (Very old CPU from 2011). The validation is almost instantaneous with my python program. For base 30, testing all even exponents from 2 to 10,000 takes 6 minutes 30 seconds with the C program and 55 seconds with my python program. I'm sorry I don't know what's going on. I know the C should be a lot faster. Moreover, I cannot understand the program in C ! Please find in attached file my program in python. I tried to comment on it to make it clearer. I hope my comments will be enough for you ...
It was nowhere near quick enough. I rewrote the sigma calculation to use the well-known closed-form formula instead of a loop, and that significantly sped it up. The test you used (base 30 from 2 to 10k) now takes 2.2 seconds on my Kubuntu Focus. The new version is attached. I also found that s(30^(80640*3)) is in fact abundant, which is backed up by work I've posted on FactorDB.

Edit: The same range takes 6.3 seconds on my 2009-era Core 2 Quad desktop, which is a more similar comparison to your computer. I'd say that blows your script out of the water.
Attached Files
 powerAbundance_1.tar.gz (1.4 KB, 40 views)

Last fiddled with by Happy5214 on 2021-03-21 at 12:30 Reason: Desktop timing

2021-03-21, 13:22   #1010
garambois

"Garambois Jean-Luc"
Oct 2011
France

3·227 Posts

Quote:
 Originally Posted by yoyo I take bases 58 2310 30030 510510 9699690 82589933.
Thank you very much !
I hope I can do the update today, I'm terribly short of time !

2021-03-21, 14:22   #1011
garambois

"Garambois Jean-Luc"
Oct 2011
France

3×227 Posts

Quote:
 Originally Posted by Happy5214 It was nowhere near quick enough. I rewrote the sigma calculation to use the well-known closed-form formula instead of a loop, and that significantly sped it up. The test you used (base 30 from 2 to 10k) now takes 2.2 seconds on my Kubuntu Focus. The new version is attached. I also found that s(30^(80640*3)) is in fact abundant, which is backed up by work I've posted on FactorDB. Edit: The same range takes 6.3 seconds on my 2009-era Core 2 Quad desktop, which is a more similar comparison to your computer. I'd say that blows your script out of the water.

Many, many thanks !
8 seconds now for the program written in C against 55 seconds for the python program !
Congratulations !
So I'm going to stop my three python programs for bases 3, 5 and 7 and start your program in C.
I'm just going to add a hard drive backup of the exponents that generate abundant index 1 terms.

It is wonderful to all work together on this problem.
If we find what we are looking for for a base which is a prime number, we will have worked very well !

On your side, let me know if you manage to make the program even faster : this is what happened to me several times with my program in python !
But this time around, I think it's going to be very difficult to gain more speed ...

 2021-03-21, 15:06 #1012 garambois     "Garambois Jean-Luc" Oct 2011 France 3·227 Posts Please I am unable to add the correct line of code to write this in bold below in my save file called "power_abundant_exponents" : 30 55440 (base + exponent) As you can see, I only manage to write the exponent i and not the base, because I don't know the equivalent for "base" of "% d" that works for i. I do not know the type of "base". By the way, "% d" does not seem correct to me for the variable i, because it can be very large ! But it seems to work ! Code:  if (n > partial) { fff = fopen ("power_abundant_exponents", "a"); if (fff == NULL) printf("Impossible to open file !"); else { fprintf (fff, "%d\n",i); fclose (fff); cout << base.get_str() << "^" << i << " is abundant !" << endl; }; } else { // cout << base.get_str() << "^" << i << " is not abundant." << endl; }

 Similar Threads Thread Thread Starter Forum Replies Last Post fivemack FactorDB 46 2021-02-21 10:46 schickel FactorDB 18 2013-06-12 16:09 garambois Aliquot Sequences 34 2012-06-10 21:53 Andi47 FactorDB 21 2011-12-29 21:11 schickel mersennewiki 0 2008-12-30 07:07

All times are UTC. The time now is 16:32.

Tue Oct 26 16:32:11 UTC 2021 up 95 days, 11:01, 0 users, load averages: 1.64, 1.46, 1.41