Marin Software interview question

Write a program to find the magic triangle or summation n