# DIOSEARCH -- look for solutions to # a Diophantine equation # # diosearch(f,100,100) prints all solutions to # # f(x,y) = 0 # # where # # 0 <= x <= a, 0 <= y <= b. # # For example, try Pell's equation: set # # f := (x,y) -> x^2 - 2*y^2 - 1; # # diosearch := proc(f,a,b) local i, j, count; count := 0; for i from 0 to a do for j from 0 to b do if f(i,j) = 0 then print( i, j ); count := count + 1; fi; od; od; RETURN( count ); end: # jac, 6/10/2001