Do you want arbitrary length or fixed length of number ?

Your loop stop due to 8² + 9² = 145 arbitrary length