# [Python 2], <s>193</s> ... <s>179</s> 178 bytes <!-- language-all: lang-python --> d=10 u=d**2000 v=u*u def s(n,a=d,i=9): while a-i:i,a=a,(a+n/a)/2 return a p,q,r,t=s(2*v),s(3*v),1,0 while p:t+=(p+q)%d*r;p/=d;q/=d;r*=d for i in range(1000):print t/u;t=v/(t%u) [Try it online!][TIO-je1l2oqs] [Python 2]: https://docs.python.org/2/ [TIO-je1l2oqs]: https://tio.run/##JY7BCsMgEAXvfsVeCmosGnuqYT9G0DRCMcasKf16m9DLGxgYeOVLy5pt7wFHwxoGKa0xhh3YZGMhzrDzrDwGlfApHIPPkt4R/D25dGqvuB@y9kJbBjVSqxk8K2pTVRHu3MpDqJ0/LozKsH9dHA3Iy7CJW5B1KhrDtF1TJQY2rxUSpAzV51fk43lHuFJTJiDdJsJDc7o10fsP "Python 2 – Try It Online" Calculating `sqrt(2)` and `sqrt(3)` to such a precision with a short code is a tough job in Python and other languages. <s>2000 digits is needed to ensure the expansion is correct</s> (1020 suffices, but I'm not going to modify it because no improvement), and lines 4-6 is the integer square root. **193 > 180 : The digit-wise modulo sum is now carried by a loop instead of array manipulation** **180 > 179 : Replaced the 6 occurrences of `10` using `d` with the cost of defining with 5 bytes, cutting 1 byte in total** **179 > 178 : Just realized that `a!=i` can be replaced by `a-i`**