I think this is the easiest way to generate pi. It's also relatively quick in Scratch.
Read about the Gregory-Leibniz series here: https://en.wikipedia.org/wiki/Leibniz_formula_for_π