Generalized Prime Sequence Conjecture With Application (Jihyeon Yoon) 2023
Generalized Prime Sequence Conjecture With Application (Jihyeon Yoon) 2023
with Application
Jihyeon Yoon*
Abstract
Prime number could be formalized with using notation of sequence. And by uti-
lizing the sequence, approximation in generating prime number could be achieved.
Mn = n(n + 1)(n + 2)
=⇒ ∀p ≥ 3 =⇒ pn = k + α1 M1 + α2 M2 + α3 M3 · · ·
(∀α ∈ P ∪ {0, 1}, k ∈ {0, 1, 3, 5})
2 Application
For example in approximated simplified form:
*
Mabangjin Software
Jihyeon Yoon is a korean medicine doctor. And he is a freelancer programmer also.
E-mail: [email protected]
Yeongdeungpo-gu, Seoul, 07429,
Seoul, South Korea
ORCiD: https://orcid.org/0000-0001-9610-0994
1
f0 (an ) = 0 + ax · 6 + ay · 24
f1 (an ) = 1 + ax · 6 + ay · 24
f3 (an ) = 3 + ax · 6 + ay · 24
f5 (an ) = 5 + ax · 6 + ay · 24
(x ∈ N1 ), y ∈ N1 )
f0 (an ) if f0 (an ) ∤ a∀z and z (∈ N1 ) ≤ n
f (a ) if f1 (an ) ∤ a∀z and z (∈ N1 ) ≤ n
1 n
an+1 =
f3 (an ) if f3 (an ) ∤ a∀z and z (∈ N1 ) ≤ n
f5 (an ) if f5 (an ) ∤ a∀z and z (∈ N1 ) ≤ n
2.1 Testing
2.1.1 Main Code
1 import math
2 import time
3
4 LIMIT = 5000000 # Prime number generation target limit
5
6 def get_n_multiplier (nth) :
7 return nth * nth * nth + 3 * nth * nth + 2 * nth
8
9 def get_max_n_multiplier (n) :
10 cnt = 0
11 while True:
12 if n < get_n_multiplier (cnt) :
13 return cnt - 1
14 else :
15 cnt = cnt + 1
16
17 def get_ecf (mul , plus) :
18 ret = 0
19 for i, m in enumerate (mul) :
20 ret = ret + get_n_multiplier (i) * m
21 return ret + plus
22
23 def prime_checker (n, dividers ) :
24 copy_dividers = []
25 for i, p in enumerate ( dividers ) :
26 if (n % p) == 0 :
27 return False , None
28 if (p % n) != 0 :
29 copy_dividers . append (p)
30
31 return True , copy_dividers
2
32
33 def sqrt_prime_checker (n) :
34 for i in range (2, int(math.sqrt(n) + 1)) :
35 if (n % i) == 0:
36 return False
37 return True
38
39 primes = [2, 3, 5, 7, 11]
40
41 tp_cnt = 0
42 tn_cnt = 0
43 fp_cnt = 0
44 fn_cnt = 0
45
46 def recursive_prime (lis , depth , limit , primes ) :
47 global tp_cnt
48 global fp_cnt
49 global tn_cnt
50 global fn_cnt
51 if depth == 1 :
52 return
53 last_p_count = 0
54 flag = False
55 generated_primes = [2]
56 while last_p_count != len( generated_primes ) :
57 last_p_count = len( generated_primes )
58 if flag :
59 break
60 max_prime = max( generated_primes )
61 for ind , p in enumerate ( primes ) :
62 if flag :
63 break
64 if lis [-1] >= p :
65 continue
66 copy_lis = lis + [p]
67 for en in [0, 1, 3, 5]:
68 calc = int( get_ecf (copy_lis , en))
69 if calc > limit :
70 flag = True
71 break
72 if calc == 1 :
73 continue
74 if calc in primes :
75 continue
76 prime_tf , new_primes = prime_checker (calc , primes )
77 if prime_tf :
78 spc = sqrt_prime_checker (calc) # To check accuracy
79 if spc == True :
80 tp_cnt = tp_cnt + 1
81 else :
82 fp_cnt = fp_cnt + 1
83 print (calc , spc , copy_lis , tp_cnt , fp_cnt , tn_cnt , fn_cnt
, ( tp_cnt + fn_cnt )/( tp_cnt + fp_cnt + tn_cnt + fn_cnt ), end='\n')
3
84 primes = new_primes
85 primes . append (calc)
86 generated_primes . append (calc)
87 else :
88 spc = sqrt_prime_checker (calc) # To check accuracy
89 if spc == True :
90 tn_cnt = tn_cnt + 1
91 else :
92 fn_cnt = fn_cnt + 1
93 copy_primes = primes .copy ()
94 for p in copy_primes :
95 if lis [ -1] >= p :
96 continue
97 copy_lis = lis + [p]
98 ret = recursive_prime (copy_lis , depth - 1, limit , primes )
99
100 start = time.time ()
101 recursive_prime ([0] , 3, LIMIT , primes )
102 end = time.time ()
103 print ('GPSC Time elapsed /', end - start , tp_cnt , fp_cnt , tn_cnt , fn_cnt ,
tp_cnt +fn_cnt , ( tp_cnt + fn_cnt )/( tp_cnt + fp_cnt + tn_cnt + fn_cnt ))
4
2.1.3 Testing Environment
(In preparation with computing cluster environment.)
3 Conclusion
1. As conjecture, by using sequence, prime number could be formalized.
References
[1] Jean-Marie De Koninck and Nicolas Doyon. The Life of Primes in 37 Episodes. Amer-
ican Mathematical Soc., 5 2021.