mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Aliquot Sequences (https://www.mersenneforum.org/forumdisplay.php?f=90)
-   -   Aliquot sequences that start on the integer powers n^i (https://www.mersenneforum.org/showthread.php?t=23612)

garambois 2021-03-20 17:01

[QUOTE=Happy5214;574176]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.
[/QUOTE]

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=Happy5214;574176]
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. :smile: 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.[/QUOTE]

In French, it's very different.
It has nothing to do with whether a number is masculine or feminine. We say "[U]la[/U] moitié d'un nombre" (half of a number), because "moitié" is feminine and "[U]le[/U] double d'un nombre" (the double of a number), because "double" is masculine !
We understand better why automatic translation is so difficult !

Happy5214 2021-03-20 19:35

1 Attachment(s)
[QUOTE=garambois;574216]In French, it's very different.
It has nothing to do with whether a number is masculine or feminine. We say "[U]la[/U] moitié d'un nombre" (half of a number), because "moitié" is feminine and "[U]le[/U] double d'un nombre" (the double of a number), because "double" is masculine !
We understand better why automatic translation is so difficult ![/QUOTE]

I'm so glad English got rid of grammatical gender for those reasons.

[QUOTE=garambois;574216]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]

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[/code]

(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.

EdH 2021-03-20 20:55

[QUOTE=garambois;574216]I do this work with the python language !
. . .
[/QUOTE]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!

VBCurtis 2021-03-20 22:51

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.

garambois 2021-03-21 10:47

1 Attachment(s)
[QUOTE=Happy5214;574237]
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[/code](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]


[QUOTE=EdH;574241]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![/QUOTE]


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 ...

garambois 2021-03-21 10:55

[QUOTE=VBCurtis;574245]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.[/QUOTE]


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 !

yoyo 2021-03-21 12:16

I take bases 58 2310 30030 510510 9699690 82589933.

Happy5214 2021-03-21 12:21

1 Attachment(s)
[QUOTE=garambois;574271]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 ...[/QUOTE]

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)) [I]is[/I] 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.

garambois 2021-03-21 13:22

[QUOTE=yoyo;574276]I take bases 58 2310 30030 510510 9699690 82589933.[/QUOTE]

Thank you very much !
I hope I can do the update today, I'm terribly short of time !

garambois 2021-03-21 14:22

[QUOTE=Happy5214;574277]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)) [I]is[/I] 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.[/QUOTE]


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 ...

:smile:

garambois 2021-03-21 15:06

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" :
[B]30 55440[/B] (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
{
[B] fprintf (fff, "%d\n",i);[/B]
fclose (fff);
cout << base.get_str() << "^" << i << " is abundant !" << endl;
};
} else {
// cout << base.get_str() << "^" << i << " is not abundant." << endl;
}[/CODE]


All times are UTC. The time now is 22:27.

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