Basic pi to nth digit with limited iterations