I am trying to understand how to find solutions for a problem when parameters are limited to positive integers. Example: 30x+19= 7y+1 =a ; where x,y,a are positive integers Wolframalpha outputs: a = 210 n + 169, x = 7 n + 5, y = 30 n + 24, n element Z(integers) 30*7= 210 (obviously) How do I calculate 169? I can do it by hand, but am likely missing something obvious generating a universal equation. I am trying to find a formula to solve for C5 below: (C1 * X) +C2 = (C3*Y) + C4 = (C1*C3*n) +C5 ; where C1,C2,C3,C4 are constants and X,Y,n are the set of positive integers. Looking for a formula for smallest integer solution C5 Any suggestions?