mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2015-07-11, 14:54   #1
irina
 
Jul 2015

22 Posts
Default Algebraithm for calculating primes

For prime number A, there is only one value B, such that what А + В2 = С2
В = (А-1)/2
С = (А+1)/2
А = С2 – В2 = (С-В)*(С+В)
С – В = 1
If the number of semiprime A = k1 * k2, then there are at least two values, such that А + В2 = С2
1. 1) А = С2 – В2 = (С-В)*(С+В);
k1 = C-B; k2= C + B
B2 = (n + trunc (sqrt (A))2 – A;
n – natural number [1; +∞);
C = n + trunc (sqrt (A))
2. 2) А = С2 – В2 = (С-В)*(С+В); С – В = 1
В = (А-1)/2 (B- maximum)
С = (А+1)/2

Example, А = 21
B1 = (А-1)/2 = (21-1)/2 = 10;
С = (А+1)/2 = (21+1)/2 = 11
21 + 102 = 112
If semiprime A, then there is at least one value В2< B1:
Sqrt (21) = 4,58257..
Trunc (4,58257) = 4
B2 = (n + 4)2 – 21
for n =1 B2 = (1+4)2 – 21 = 4; B = 2;
C = n+ 4 = 1 + 4 =5
A = С2 – В2 = (С-В)*(С+В) = (5 – 2)*(5+2) = 3*7
А=k1 * k2= 3*7

Last fiddled with by Batalov on 2015-07-11 at 16:02 Reason: fixed formatting for squares (only that)
irina is offline   Reply With Quote
Old 2015-07-11, 17:57   #2
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

101000000000102 Posts
Default

Another algorithm for calculating primes
xilman is offline   Reply With Quote
Old 2015-07-11, 21:16   #3
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

5×181 Posts
Default

For even more awesomeness you could use Deterministic M-R with ceil(n/4) as the limit.

(I really wish the previously referenced task could be renamed, as far too many people think what is described is actually AKS)

Tempted to post the primality regex...

Last fiddled with by danaj on 2015-07-11 at 21:17
danaj is offline   Reply With Quote
Old 2015-07-13, 12:24   #4
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

11101001001002 Posts
Default

Quote:
Originally Posted by irina View Post
For prime number A, there is only one value B, such that what А + В2 = С2
В = (А-1)/2
С = (А+1)/2
А = С2 – В2 = (С-В)*(С+В)
С – В = 1
If the number of semiprime A = k1 * k2, then there are at least two values, such that А + В2 = С2
1. 1) А = С2 – В2 = (С-В)*(С+В);
k1 = C-B; k2= C + B
B2 = (n + trunc (sqrt (A))2 – A;
n – natural number [1; +∞);
C = n + trunc (sqrt (A))
2. 2) А = С2 – В2 = (С-В)*(С+В); С – В = 1
В = (А-1)/2 (B- maximum)
С = (А+1)/2

Example, А = 21
B1 = (А-1)/2 = (21-1)/2 = 10;
С = (А+1)/2 = (21+1)/2 = 11
21 + 102 = 112
If semiprime A, then there is at least one value В2< B1:
Sqrt (21) = 4,58257..
Trunc (4,58257) = 4
B2 = (n + 4)2 – 21
for n =1 B2 = (1+4)2 – 21 = 4; B = 2;
C = n+ 4 = 1 + 4 =5
A = С2 – В2 = (С-В)*(С+В) = (5 – 2)*(5+2) = 3*7
А=k1 * k2= 3*7
This is nothing but trivial algebra. Where is the ALGORITHM?
You have failed to specify any kind of procedure. All you have done is
assert the existence of some values satisfying some relations.
R.D. Silverman is offline   Reply With Quote
Old 2015-07-13, 12:27   #5
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

3·23·83 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
This is nothing but trivial algebra. Where is the ALGORITHM?
Algebraithm for calculating primes?
retina is online now   Reply With Quote
Old 2015-08-16, 01:55   #6
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

33·72 Posts
Default

Quote:
Originally Posted by irina View Post
For prime number A, there is only one value B, such that what А + В2 = С2
В = (А-1)/2
С = (А+1)/2
А = С2 – В2 = (С-В)*(С+В)
С – В = 1
If the number of semiprime A = k1 * k2, then there are at least two values, such that А + В2 = С2
1. 1) А = С2 – В2 = (С-В)*(С+В);
k1 = C-B; k2= C + B
B2 = (n + trunc (sqrt (A))2 – A;
n – natural number [1; +∞);
C = n + trunc (sqrt (A))
2. 2) А = С2 – В2 = (С-В)*(С+В); С – В = 1
В = (А-1)/2 (B- maximum)
С = (А+1)/2

Example, А = 21
B1 = (А-1)/2 = (21-1)/2 = 10;
С = (А+1)/2 = (21+1)/2 = 11
21 + 102 = 112
If semiprime A, then there is at least one value В2< B1:
Sqrt (21) = 4,58257..
Trunc (4,58257) = 4
B2 = (n + 4)2 – 21
for n =1 B2 = (1+4)2 – 21 = 4; B = 2;
C = n+ 4 = 1 + 4 =5
A = С2 – В2 = (С-В)*(С+В) = (5 – 2)*(5+2) = 3*7
А=k1 * k2= 3*7
It appears that you suggest to select n=1, 2, 3, ... until you get the factorization. This is just Fermat's method.
alpertron is offline   Reply With Quote
Old 2018-05-28, 13:50   #7
irina
 
Jul 2015

1002 Posts
Arrow Mersenne prime number search algorithm

?

Last fiddled with by irina on 2018-05-28 at 14:00
irina is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
A New Methodology For Calculating Primes howequan No Prime Left Behind 4 2017-10-30 09:00
calculating with circles diep Homework Help 9 2014-07-12 12:14
Calculating optimal P-1 memory Uncwilly Lounge 5 2013-05-15 23:29
Calculating E based on B1 c10ck3r Math 1 2012-02-22 06:29
Calculating a difficult sum CRGreathouse Math 3 2009-08-25 14:11

All times are UTC. The time now is 15:36.

Mon Sep 21 15:36:24 UTC 2020 up 11 days, 12:47, 1 user, load averages: 1.51, 1.76, 1.83

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.