Skip to main content
2 of 4
added 72 characters in body
beary605
  • 4.4k
  • 2
  • 27
  • 53

Python (136 133)

The standard method for continued fractions, extremely golfed.

a=input()**.5 D=int(a);b=[];d=0 while True: a=1/(a%1) b+=[int(a)] d+=1 c=b[:d/2] if c==b[d/2:]:print D,";%s;"%str(c)[1:-1];break 
beary605
  • 4.4k
  • 2
  • 27
  • 53