Code: Select all
arctan(1/x) + arctan(1/y) = arctan(1/u)
u will be given, find the minimal sum x+y , x,y,u are all positive
integers
1/x + 1/y
--------- = 1/u
1 - 1/xy
u*(x+y) = xy-1
let x+y = k ,
then u*k = x*(k-x) -1 ,
x^2 -x*k +u*k +1 =0
x should i have real roots
x={-k+- sqrt(k^2 - 4u*k -4)}/2
so k^2 -4u*k -4 should be a perfect square , minimal k for which
k^2 -4u*k -4 is a perfect square
we have iterate through k to find out, for k=3072 or some number close
3000 i couldn't find k until 10^7 , how do we solve this
am i going in the right direction