mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   gophne (https://www.mersenneforum.org/forumdisplay.php?f=149)
-   -   "New" primality test/check (https://www.mersenneforum.org/showthread.php?t=22838)

gophne 2017-12-31 16:36

[QUOTE=science_man_88;475590]The math has been shown already. I like to play around more than most here.[/QUOTE]
MORE COMMENTS....PLEASE STATE THE MATH FOR THOSE THAT MIGHT HAVE MISSED IT.

If the algorithms are the same...substitute values into the formulas and report what comes out ! Please!

I think everybody is crying out for this. May I suggest that you start with the number 1 or any other number that tickles your fancy.

That is what we did at primary school be entering numbers into little squares to make the answer true.

For Pete's sake.

science_man_88 2017-12-31 16:45

It's literally a transform of n+2---------->n in you formula and then a reworking it.

Batalov 2017-12-31 16:56

1 Attachment(s)
[QUOTE=gophne;475598]MORE COMMENTS....

...That is what we did at primary school be entering numbers into little squares to make the answer true.

For Pete's sake.[/QUOTE]
Suppose you wanted to learn the piano and transposed the Moonlight sonata into a more convenient key (from the original c# minor ...that, obviously everyone knows :rolleys:). You cannot go around claiming that you wrote new music.

Suppose you don't understand sheet music at all. Don't expect us to explain it after 3- 4 attempts as you clearly need a music teacher and study for >5 years to play this --

ATH 2017-12-31 17:03

[QUOTE=gophne;475598]MORE COMMENTS....PLEASE STATE THE MATH FOR THOSE THAT MIGHT HAVE MISSED IT.[/QUOTE]

It was you that missed the math or rather you did not understand.

We claim your algorithm is the fermat pseudoprime test to base 2, so test your algorithm on numbers up to say 10,000. We claim it will find the real primes as well as these composite numbers as "false positives":

[url]http://oeis.org/A001567[/url]
341, 561, 645, 1105, 1387, 1729, 1905, 2047, 2465, 2701, 2821, 3277, 4033, 4369, 4371, 4681, 5461, 6601, 7957, 8321, 8481, 8911

Here are the list of real primes if you need it:
[url]https://primes.utm.edu/lists/small/10000.txt[/url]

science_man_88 2017-12-31 17:25

A bit more explicit.


2^n-1 == (n+1)/2 mod (n+2)
2^((n+2)-2)-1== ((n+2)-1)/2 mod (n+2)
Replacing n+2 with n we get:
2^(n-2)-1==(n-1)/2 mod n
2^(n-1)-2==n-1 mod n
2^(n-1)== n+1 mod n

Casting out the terms that don't affect the remainder we get.

2^(n-1)==1 mod n QED edit if this doesn't register you need to brush up on mathematical laws like the law of replacement, or you need to look up what modular arithmetic is.

guptadeva 2017-12-31 17:55

1 Attachment(s)
[QUOTE=gophne;475598]
If the algorithms are the same...substitute values into the formulas and report what comes out ! Please!
[/QUOTE]

the algorithms are the same just take a look for yourself:

[ATTACH]17438[/ATTACH]

on the left side (in red) are the numbers from "your" algorithm and on the right side (in green) are the numbers from fermat

it really does not matter what the exact numbers are therein ... only the fact, that all the numbers that are equal on the left side correspond to some other numbers that are equal on the right side is important here !

can you see, that all the equal signs are in the same positions in both algorithms ?
now, the tables are only having 14 lines each but do you think, that the equal signs would always be in the same positions if both tables had 100 lines or even 1000 lines ?

you are welcome to make the calculations yourself and you will see that the equal signs [U]always[/U] stay in the same positions ?

how do we know this without actually having made such huge tables ?

well, we use modular math - you should really take your time and learn what this mod function is all about:

the "rules" for the mod-function do not equal to the rules of the normal equal sign
so you might take a look on

[URL]https://en.wikipedia.org/wiki/Modular_arithmetic[/URL]

or other pages on the internet to learn what these "rules" are ... and also more important to truely understand WHY they are in that way they are.

the "experts" on this forum have spent quite a long time to practice and finally truely understand this WHY

this is the reason for their statement that the two algorithms are exactly the same ...

using the mod-function is as simple and easy as playing the moonlight sonata on piano for them

gophne 2017-12-31 18:35

[QUOTE=science_man_88;475603]It's literally a transform of n+2---------->n in you formula and then a reworking it.[/QUOTE]
Hi science_man_88

Please run the algorithms and POST the results. I do not have X-ray eyes ;)

gophne 2017-12-31 18:39

[QUOTE=Batalov;475607]Suppose you wanted to learn the piano and transposed the Moonlight sonata into a more convenient key (from the original c# minor ...that, obviously everyone knows :rolleys:). You cannot go around claiming that you wrote new music.

Suppose you don't understand sheet music at all. Don't expect us to explain it after 3- 4 attempts as you clearly need a music teacher and study for >5 years to play this --[/QUOTE]
Hi Batalov

Regretfully commentary would not suffice as proof of the identity of the algorithms under the spotlight.

By the way, do you know what the algorithm /formula is that [B]awmayer[/B] was reducing to? What is his source or the name of this formula/algorithm?

gophne 2017-12-31 18:46

[QUOTE=guptadeva;475614]the algorithms are the same just take a look for yourself:

[ATTACH]17438[/ATTACH]

on the left side (in red) are the numbers from "your" algorithm and on the right side (in green) are the numbers from fermat

it really does not matter what the exact numbers are therein ... only the fact, that all the numbers that are equal on the left side correspond to some other numbers that are equal on the right side is important here !

can you see, that all the equal signs are in the same positions in both algorithms ?
now, the tables are only having 14 lines each but do you think, that the equal signs would always be in the same positions if both tables had 100 lines or even 1000 lines ?

you are welcome to make the calculations yourself and you will see that the equal signs [U]always[/U] stay in the same positions ?

how do we know this without actually having made such huge tables ?

well, we use modular math - you should really take your time and learn what this mod function is all about:

the "rules" for the mod-function do not equal to the rules of the normal equal sign
so you might take a look on

[URL]https://en.wikipedia.org/wiki/Modular_arithmetic[/URL]

or other pages on the internet to learn what these "rules" are ... and also more important to truely understand WHY they are in that way they are.

the "experts" on this forum have spent quite a long time to practice and finally truely understand this WHY

this is the reason for their statement that the two algorithms are exactly the same ...

using the mod-function is as simple and easy as playing the moonlight sonata on piano for them[/QUOTE]
Hi guptadeva

This is more in line with what we need. From what you say indications are that the two algorithms are the same.

However, I cannot make out anything on the image you posted, could you perhaps tabulate the results and the algorithms that generated them (as well as the inputs).

Thanx, Regards.

gophne 2017-12-31 18:57

[QUOTE=ATH;475608]It was you that missed the math or rather you did not understand.

We claim your algorithm is the fermat pseudoprime test to base 2, so test your algorithm on numbers up to say 10,000. We claim it will find the real primes as well as these composite numbers as "false positives":

[url]http://oeis.org/A001567[/url]
341, 561, 645, 1105, 1387, 1729, 1905, 2047, 2465, 2701, 2821, 3277, 4033, 4369, 4371, 4681, 5461, 6601, 7957, 8321, 8481, 8911

Here are the list of real primes if you need it:
[url]https://primes.utm.edu/lists/small/10000.txt[/url][/QUOTE]
Hi ATH

Thanx for indicating the numbers that are the same. Can you give us the EXACT breakdown that each of the Algorithms generate as well please, for the record or at least say the first 30 terms of each.

Regards

gophne 2017-12-31 19:05

[QUOTE=science_man_88;475610]A bit more explicit.


2^n-1 == (n+1)/2 mod (n+2)
2^((n+2)-2)-1== ((n+2)-1)/2 mod (n+2)
Replacing n+2 with n we get:
2^(n-2)-1==(n-1)/2 mod n
2^(n-1)-2==n-1 mod n
2^(n-1)== n+1 mod n

Casting out the terms that don't affect the remainder we get.

2^(n-1)==1 mod n QED edit if this doesn't register you need to brush up on mathematical laws like the law of replacement, or you need to look up what modular arithmetic is.[/QUOTE]
Hi science_man_88

Your math is incorrect;

LHS of == sign

2^n-1....let n=5

Then LHS result is 31

RHS of == sign

(n+1)/2 mod (n+2).......substitute for n=5

(5+1)/2 mod (5+2)

RHS result is =3


All times are UTC. The time now is 21:57.

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