added triangular numbers function