+ 1
Python program to enter Positive number N and find numbers a and b such that a2 - b2 = N
4 Answers
+ 13
well there are infinite such possibilities for a , b , N belonging to set of natural numbers & following condition a*2-b*2=N
//N must be even
if a2 denotes a^2 ... then
a^2=b^2+N ... run a loop for b & find if b^2+ N is forming some perfect square ... if so then that will be corresponding value of a
but that is hard to know what can be the maximum value b can take
+ 4
a^2-b^2=(a-b)*(a+b)=N
find some factorization of N
+ 1
thanks
0
hello