Group Abstract Group Abstract

Message Boards Message Boards

4
|
7K Views
|
2 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Search for prime numbers greater than 5

Posted 6 years ago
POSTED BY: Koichi Ohno
2 Replies
Posted 6 years ago

William-san

Thank you for your comments.

The program that you have shown kindly can be a great help.

I didn't know "trial factorization", so I will study from now on.

After all, there are so many functions in Mathematica that only a part of them are used. It is a pleasure to open my sight through the readers of the Wolfram Community.

(-san is a title in Japanese)

POSTED BY: Koichi Ohno
Posted 6 years ago

I'd like to point out that solving these equations is equivalent to trial factorization of the number $6n\pm1$ under consideration. Take the first of the four equations and rewrite it in terms of say $z=6n-1$:

z = 6n-1 /. n->(6s^2 + (6s-1)(m-1) ) // Simplify

(-1 + 6 s) (-5 + 6 m + 6 s)

The second equation picks out the complementary set of possible factors:

z = 6n-1 /. n->(6s^2 +6s + 1 + (6s+1)(m-1) ) // Simplify

(1 + 6 s) (-1 + 6 m + 6 s)

For example, the first composite $6n-1$ for $n=6$ ( $z=35$) has a solution to $(1a(1))$ of ${s=1,m=1}$; this corresponds to the factors $6s-1=5$ and $6s+6m-5=7$.

We can similarly manipulate the equations $(1b)$ to find their algebraic factorizations for any $z'=6n+1$.

The functions PrimeQ[] and NextPrime[] will be faster than solving these equations (i.e., trial factorization).

POSTED BY: William Isaacs
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard