add a generate view, use it to finish the Pythagorean triples example