0% found this document useful (0 votes)
19 views5 pages

Generalized Prime Sequence Conjecture With Application (Jihyeon Yoon) 2023

Uploaded by

arnoldo3551
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Generalized Prime Sequence Conjecture With Application (Jihyeon Yoon) 2023

Uploaded by

arnoldo3551
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Generalized Prime Sequence Conjecture

with Application
Jihyeon Yoon*

March 21, 2023

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.

1 Generalized Prime Sequence Conjecture


Prime number[1] could be defined as following:

p ∈ N is prime ⇐⇒ ∄n ∈ N s.t. n | p and n ̸= p, 1.

Generalized Prime Sequence Conjecture(GPSC) is:

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 ))

2.1.2 Comparison Code


I would compare this algorithm with normally used square-root approach, in following
Python 3 code:
1 import math
2 import time
3
4 LIMIT = 5000000 # Prime number generation target limit
5
6 true_cnt = 0
7 false_cnt = 0
8 start = time.time ()
9 for i in range (2, LIMIT) :
10 if i % 2 == 0 :
11 continue
12 flag = True
13 for j in range (3, int(math.sqrt( LIMIT )), 2) :
14 if (i % j)==0 :
15 flag = False
16 false_cnt = false_cnt + 1
17 break
18 if flag :
19 true_cnt = true_cnt + 1
20 end = time.time ()
21 print ('Square Root Time elapsed /', end - start , true_cnt , false_cnt ,
true_cnt + false_cnt )

4
2.1.3 Testing Environment
(In preparation with computing cluster environment.)

2.1.4 Testing Result


(In preparation with computing cluster environment.)

3 Conclusion
1. As conjecture, by using sequence, prime number could be formalized.

2. Approximation by using the conjecture could be applied in generating prime num-


ber.

3. Utilizing GPSC could be a way of suggesting an efficient way to generate prime


number.

References
[1] Jean-Marie De Koninck and Nicolas Doyon. The Life of Primes in 37 Episodes. Amer-
ican Mathematical Soc., 5 2021.

You might also like