HCLTech Interview Question

What is the logic for the Prime Triangle