n=139*271 r=1while r<n: s,R=divmod(n-r,2*r+1) if R==0: print(s,r) assert n==2*r*s+r+s r+=1
Standard input is empty
12556 1 4185 4 3424 5 1141 16 380 49 49 380 16 1141 5 3424 4 4185 1 12556
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!