File size: 700 Bytes
0b65cde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def is_prime(x):
    if x < 2:
        return False
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True

def get_factors(x):
    factors = []
    for i in range(1, x + 1):
        if x % i == 0:
            factors.append(i)
    return factors

def compute_equation(x):
    return 8 * x ** 2 + 1


x = int(input("Enter an integer: "))


if is_prime(x):
    print(f"{x} is a prime number.")
else:
    print(f"{x} is not a prime number.")

    factors = get_factors(x)
    print("Factors:", factors)

# Evaluate equation Y = 8X² + 1 
print("Equation Y = 8X² + 1:")
for i in range(-5, 6):
    y = compute_equation(i)
    print(f"X = {i}, Y = {y}")