mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Aliquot Sequences

Reply
 
Thread Tools
Old 2021-03-20, 17:01   #1002
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

677 Posts
Default

Quote:
Originally Posted by Happy5214 View Post
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 View Post
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 !
garambois is offline   Reply With Quote
Old 2021-03-20, 19:35   #1003
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

739 Posts
Default

Quote:
Originally Posted by garambois View Post
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 View Post
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
File Type: gz powerAbundance.tar.gz (1.4 KB, 29 views)
Happy5214 is offline   Reply With Quote
Old 2021-03-20, 20:55   #1004
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

391610 Posts
Default

Quote:
Originally Posted by garambois View Post
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!
EdH is offline   Reply With Quote
Old 2021-03-20, 22:51   #1005
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

134F16 Posts
Default

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
VBCurtis is offline   Reply With Quote
Old 2021-03-21, 10:47   #1006
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

677 Posts
Default

Quote:
Originally Posted by Happy5214 View Post
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 View Post
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
File Type: gz bid_even_en.sage.tar.gz (1.4 KB, 37 views)
garambois is offline   Reply With Quote
Old 2021-03-21, 10:55   #1007
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

677 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
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 !
garambois is offline   Reply With Quote
Old 2021-03-21, 12:16   #1008
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

54 Posts
Default

I take bases 58 2310 30030 510510 9699690 82589933.
yoyo is offline   Reply With Quote
Old 2021-03-21, 12:21   #1009
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

739 Posts
Default

Quote:
Originally Posted by garambois View Post
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
File Type: gz powerAbundance_1.tar.gz (1.4 KB, 36 views)

Last fiddled with by Happy5214 on 2021-03-21 at 12:30 Reason: Desktop timing
Happy5214 is offline   Reply With Quote
Old 2021-03-21, 13:22   #1010
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

2A516 Posts
Default

Quote:
Originally Posted by yoyo View Post
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 !
garambois is offline   Reply With Quote
Old 2021-03-21, 14:22   #1011
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

677 Posts
Default

Quote:
Originally Posted by Happy5214 View Post
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 ...

garambois is offline   Reply With Quote
Old 2021-03-21, 15:06   #1012
garambois
 
garambois's Avatar
 
"Garambois Jean-Luc"
Oct 2011
France

677 Posts
Default

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;
        }
garambois is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken aliquot sequences fivemack FactorDB 46 2021-02-21 10:46
Broken aliquot sequences schickel FactorDB 18 2013-06-12 16:09
A new theorem about aliquot sequences garambois Aliquot Sequences 34 2012-06-10 21:53
poaching aliquot sequences... Andi47 FactorDB 21 2011-12-29 21:11
New article on aliquot sequences schickel mersennewiki 0 2008-12-30 07:07

All times are UTC. The time now is 10:35.


Sat Sep 18 10:35:12 UTC 2021 up 57 days, 5:04, 0 users, load averages: 1.51, 1.40, 1.62

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.