V ndigits = 0 V q = BigInt(1) V r = BigInt(0) V t = q V k = q V n = BigInt(3) V l = n V first = 1B L ndigits < 1'000 I 4 * q + r - t < n * t print(n, end' ‘’) ndigits++ I ndigits % 70 == 0 print() I first first = 0B print(‘.’, end' ‘’) V nr = 10 * (r - n * t) n = ((10 * (3 * q + r)) I/ t) - 10 * n q *= 10 r = nr E V nr = (2 * q + r) * l V nn = (q * (7 * k + 2) + r * l) I/ (t * l) q *= k t *= l l += 2 k++ n = nn r = nr