creates func to get nth triangle number