Input
Given number (e.g., 53).
Call next_prime(given_value)
Increment num by 1.
Check if num is Prime:
Start loop: Check divisibility from 2 to num - 1.
- If num is divisible by any i, return False.
- If no divisors are found, return True.
- If not prime, increment num and repeat the check.
- Once a prime is found, return that prime number.
Store the result in next_prime_greater.
Call previous_prime(given_value)
Decrement num by 1.
Check if num is Prime:
Start loop: Check divisibility from 2 to num - 1.
- If num is divisible by any i, return False.
- If no divisors are found, return True.
- If not prime, decrement num and repeat the check.
- Once a prime is found, return that prime number.
Store the result in previous_prime_lesser.