import numpy as np
from sympy import nextprime


c = nextprime(np.random.randint(100,200)) * nextprime(np.random.randint(100,200))
x = np.stack([1,2])
m = np.random.rand()
k = np.random.rand()

while True:
    y = k * x**2 + m
    err1 = y[0]//1 - a
    a += 0.0001 * err1
    err2 = y[-1]//1 - b
    b += 0.0001 * err2
    err3 = c - a*b + (c//2 - c//3) - ((a*b)//2 - (a*b)//3)
    k -= 0.01 * (err3 + err2)
    m -= 0.01 * (err3 + err1)
    print(np.sum(err3)**2)
