I AM SUCH A FOOL. THE BELOW ANSWER IS WRONG
:
The question asks the largest K that cannot be formed. K's equation shows that K's maximum value is not limited in any way. The set of K numbers is countably infinite.
We must approach this question differently. We want to establish the situation where every unit increase in X or Y will create a unit increase in K. For sake of clarity, lets call the K at this point "K1". After such a point, all possible integers after "K1" can be produced by the formula for K.
Let A = 333X
Thus, 666Y = 2A*Y/X and our equation for K can be re-written as
K = A + 2A*Y/X.
The function A increases in discrete steps of 333 for each unit increase in X. This does not help our cause so ignore it.
We want to find the situation where 2A * Y/X can increase by 1 for every unit increase in X or Y.
The answer is when X = 2*333 = 666. Because at this value, 2A * Y/X is = Y. And every unit increase in Y (holding X constant at 666) will cause a 1 unit increase in K.
The K (K1) value at this point is 333*333*2 + 666 = 222,444
Thus, the largest K that cannot be formed is 222,443.