mersenneforum.org (https://www.mersenneforum.org/index.php)
-   -   Prime95 finding any prime? (https://www.mersenneforum.org/showthread.php?t=23653)

 Tamay82 2018-09-16 18:07

Prime95 finding any prime?

Hello Prime95 can you help me I want to find any prime number?
What can I do if I want to find eg, 23 is a prime number ?

 VBCurtis 2018-09-16 18:35

To determine 23 is prime, try dividing by every prime below the square root of 23.
2 and 3 do not divide 23, so 23 is prime.

 sweety439 2018-09-17 08:53

[QUOTE=Tamay82;496200]Hello Prime95 can you help me I want to find any prime number?
What can I do if I want to find eg, 23 is a prime number ?[/QUOTE]

2^23==2 mod 23, thus 23 is prime.

 LaurV 2018-09-17 12:10

[QUOTE=sweety439;496231]2^23==2 mod 23, thus 23 is prime.[/QUOTE]
2^341==2 mod 341, thus 341 is prime

 AndrewWalker 2018-09-18 10:40

[QUOTE=LaurV;496245]2^341==2 mod 341, thus 341 is prime[/QUOTE]

Ha!

(19:57) gp > (341-1)!%341
%54 = 0

Andrew

When in doubt, use Wilson's Theorem :lol:

[url]http://fredrikj.net/blog/2012/03/factorials-mod-n-and-wilsons-theorem/[/url]

 LaurV 2018-09-21 10:48

[QUOTE=AndrewWalker;496292]Ha! [/QUOTE]
:tu: haha, you made my day!

You have however a mistake in the post: you must not say "Ha!", but ":davar55:"

(and don't tell me you made 54 trials to get that right! :razz: :shock:)

 AndrewWalker 2018-09-24 12:16

I'm not sure how to respond, but anyway! :smile::davar55::shock: I used a few trials, but not that many!

It was interesting exploring how far I could push this test, I got over 1000 but then needed to increase the stack limit in gp so gave up!

Main point of my post was the link I shared.

Frederik Johansson is the main aurthor of MPMath, Arb, and has made contributions to a number of other mathematical software projects.

He made optimisations which let him test Wilson's Theorem up to 15 digits, that's crazy!!

Andrew

 ixfd64 2018-09-26 21:48

I'm not sure I this answers your question, but Prime95 can only test numbers of the form 2[SUP]p[/SUP] - 1 for primality.

 All times are UTC. The time now is 02:29.