Solution to Triangle Number

Credit to Steffen Castle