human
Write me a code to program to print tetrahedral numbers upto Nth term and the other steps required given the following:
Program to print tetrahedral numbers upto Nth term | function to generate nth triangular number.
function to print tetrahedral number series up to n.
Initialize prev as 0. It stores the sum of all previously generated triangular number.
Loop to print series.
Find ith triangular number.
Add ith triangular number to sum of all previously generated triangular number to get ith tetrahedral number.
Update sum of all previously generated triangular number.
Driver code.
function call to print series"
Solution in Python:
assistant
#Here is code to program to print tetrahedral numbers upto Nth term and the other steps required.
 def findTriangularNumber ( n ) :
	return ( n * ( n + 1 ) ) / 2
def printSeries ( n ) :
	prev = 0
	for i in range ( 1 , n + 1 ) :
		curr = findTriangularNumber ( i )
		curr = int ( curr + prev )
		print ( curr , end = ' ▁ ' )
		prev = curr
n = 10
printSeries ( n )