Search for prime numbers greater than 11 using sine functions and prime numbers. All prime numbers smaller than the square of the prime number used in the calculation are searched. For example, if you know that 5 is a prime number, {23,19,17,13,11} below 25 is calculated as a prime number. If you know that 23 is a prime number, you can know a prime number {523,521, ?} of 529 or less.
Prime numbers can be classified into two types. (6n-1) type and (6n + 1) type. This time we will search for {(6n-1) +6} and {(6n + 1) +6} types, so we will search for prime numbers greater than 11. Twin prime numbers are the same n, and (6n-1) and (6n + 1) are both prime numbers. If only one side of type (6n-1) or (6n + 1) is a prime number, it is a normal prime number. This time, the theme is a normal prime, that is, one of (6n-1) or (6n + 1) prime, but twin primes are also included in the solution.
Prime numbers can be determined by the three equations shown in (1). Prime numbers of type (6n-1) are determined by equations (1{\rm b}) and (1{\rm c}). The prime number of type (6n + 1) is determined by equation (1{\rm a}).
Use the sine function of equation (1) in combination with the ceiling function. In the negative area of { } in the sine function, set f (n, p) = 1. (see the figure below)
Next, take the prodct of f (n, p) as shown in equation (2). Equation (2{\rm a}) corresponds to a prime number of type (6n-1), and (2{\rm b}) corresponds to a prime number of type (6n + 1).
A prime number can be obtained by substituting np _m and np _p obtained in equation (2) into equation (3).
The search start number “{\rm nstart}” and end number “{\rm nend}” are given, and the program which searches the prime number which exists in the section is shown.
nstart = 1;
nend = 20;
"***************************************************************";
func1[n_] :=
If[If[n - (Prime[pn]^2 - 7)/6 < 0, 1,
Ceiling[(Sin[(2*Pi/Prime[pn])*(n - (Prime[pn]^2 - 7)/6)])^2]] ==
1, 1, 0];
func2[n_] :=
If[If[n - (Prime[pn]^2 + 2*Prime[pn] - 5)/6 < 0, 1,
Ceiling[(Sin[(2*
Pi/Prime[pn])*(n - (Prime[pn]^2 + 2*Prime[pn] - 5)/
6)])^2]] == 1, 1, 0];
func3[n_] :=
If[If[n - (Prime[pn]^2 + 4*Prime[pn] - 5)/6 < 0, 1,
Ceiling[(Sin[(2*
Pi/Prime[pn])*(n - (Prime[pn]^2 + 4*Prime[pn] - 5)/
6)])^2]] == 1, 1, 0];
Clear[npp, npm];
n = nstart;
pnmax = IntegerPart[0.7835*nend^0.7656] + 5;
Print["====== The calculation results are shown below. ======"];
Print["nstart= ", nstart];
Print["nend= ", nend];
Print["---------"];
If[IntegerQ[nstart] && IntegerQ[nend] && nstart > 0 && nend > 0 &&
nend > nstart && pnmax <= 999999999999,
Do[
If[Product[func2[n]*func3[n], {pn, 3, pnmax}] == 1, npm = n,
npm = 0];
If[Product[func1[n], {pn, 3, pnmax}] == 1, npp = n, npp = 0];
If[npm > 0, Print["npm= ", npm]];
If[npm > 0, Print["(6n-1)+6 type prime= ", 6*npm + 5]];
If[npm > 0, Print["PrimeQ[", 6*npm + 5, "]-> ", PrimeQ[6*npm + 5]]];
If[npp > 0, Print["npp= ", npp]];
If[npp > 0, Print["(6n+1)+6 type prime= ", 6*npp + 7]];
If[npp > 0, Print["PrimeQ[", 6*npp + 7, "]-> ", PrimeQ[6*npp + 7]]];
If[n == nend, Break[]], {n, nstart, nend}],
Print["===! The conditions are not met.==="]];
This is an example of {\rm nstart} = 1 and {\rm nend} = 20. The result of the calculation is output as follows:
====== The calculation results are shown below. ======
nstart= 1
nend= 20
---------
npm= 1
(6n-1)+6 type prime= 11
PrimeQ[11]-> True
npp= 1
(6n+1)+6 type prime= 13
PrimeQ[13]-> True
npm= 2
(6n-1)+6 type prime= 17
PrimeQ[17]-> True
npp= 2
(6n+1)+6 type prime= 19
PrimeQ[19]-> True
npm= 3
(6n-1)+6 type prime= 23
PrimeQ[23]-> True
npm= 4
(6n-1)+6 type prime= 29
PrimeQ[29]-> True
npp= 4
(6n+1)+6 type prime= 31
PrimeQ[31]-> True
npp= 5
(6n+1)+6 type prime= 37
PrimeQ[37]-> True
npm= 6
(6n-1)+6 type prime= 41
PrimeQ[41]-> True
npp= 6
(6n+1)+6 type prime= 43
PrimeQ[43]-> True
npm= 7
(6n-1)+6 type prime= 47
PrimeQ[47]-> True
npm= 8
(6n-1)+6 type prime= 53
PrimeQ[53]-> True
npm= 9
(6n-1)+6 type prime= 59
PrimeQ[59]-> True
npp= 9
(6n+1)+6 type prime= 61
PrimeQ[61]-> True
npp= 10
(6n+1)+6 type prime= 67
PrimeQ[67]-> True
npm= 11
(6n-1)+6 type prime= 71
PrimeQ[71]-> True
npp= 11
(6n+1)+6 type prime= 73
PrimeQ[73]-> True
npp= 12
(6n+1)+6 type prime= 79
PrimeQ[79]-> True
npm= 13
(6n-1)+6 type prime= 83
PrimeQ[83]-> True
npm= 14
(6n-1)+6 type prime= 89
PrimeQ[89]-> True
npp= 15
(6n+1)+6 type prime= 97
PrimeQ[97]-> True
npm= 16
(6n-1)+6 type prime= 101
PrimeQ[101]-> True
npp= 16
(6n+1)+6 type prime= 103
PrimeQ[103]-> True
npm= 17
(6n-1)+6 type prime= 107
PrimeQ[107]-> True
npp= 17
(6n+1)+6 type prime= 109
PrimeQ[109]-> True
npm= 18
(6n-1)+6 type prime= 113
PrimeQ[113]-> True
npp= 20
(6n+1)+6 type prime= 127
PrimeQ[127]-> True
First {\rm nstart} and {\rm nend} are displayed. Subsequently, the selected np _m or np _p is displayed and the corresponding prime number is displayed. In addition, the result of prime number judgment is shown.
Try running on a slightly larger number. In the example, {\rm nstart} = 2000000000 and {\rm nend} = 2000000200. The results are shown in Table-1. It took quite a while to calculate.
.
(I couldn’t write np_m and np_p on the table, so I made npm and npp.)
