Brahmagupta Fibonacci Identity | JavaScript program to verify Brahmagupta Fibonacci identity ; represent the product as sum of 2 squares ; check identity criteria ; 1 ^ 2 + 2 ^ 2 ; 3 ^ 2 + 4 ^ 2 ; express product of sum of 2 squares as sum of ( sum of 2 squares )
function find_sum_of_two_squares ( a , b ) { let ab = a * b ; for ( let i = 0 ; i * i <= ab ; i ++ ) { for ( let j = i ; i * i + j * j <= ab ; j ++ ) { if ( i * i + j * j == ab ) document . write ( i + " " + j + " " + ab + " " ) ; } } } let a = 1 * 1 + 2 * 2 ; let b = 3 * 3 + 4 * 4 ; document . write ( " " + " " + " " ) ; find_sum_of_two_squares ( a , b ) ;