Documentation
Input
Enter value of n (n > 1): 10
Output
Prime numbers between 10 and 20 are:
11 13 17 19
Bertrand conjecture is TRUE for n = 10
For every integer n > 1, there exists at least one prime number between n and 2n.
Logic Used
-
Read an integer
n -
Check all numbers between
n+1and2n -
Test each number for primality
-
Display the prime(s) found and confirm the conjecture
Exam Notes
-
Prime checking is done using trial division up to √n
-
If at least one prime exists in
(n, 2n), the conjecture holds -
Bertrand’s conjecture has been proven true for all n > 1