To see why the angles in a triangle add tonotice that a triangle has three sides so n=1 and the angles add to 180, a square can be cut into two triangles, each with internal angles 180, so all the internal angles of both triangles sum to 360. Consider the pentagon below. It is cut into three triangle, each with internal angles that sum to 360, so the internal angles of a pentagon sum to 3*180 =540.