** If you already know the algorithm and if you spend half an hour to steer chatGTP towards following that algorithm then it generates valid code but not with 100% accuracy. Then probably it would have been faster to ask it to generate code for the algorithm and then you execute it, since it's surprisingly better at coding than math.