human
What is a code to program to print the series 1 , 3 , 4 , 8 , 15 , 27 , 50 â €¦ till N terms and the other steps required given the following:
Program to print the series 1 , 3 , 4 , 8 , 15 , 27 , 50 â €¦ till N terms | Function to print the series.
Generate the ith term and print it.
Driver Code.
Function Call"
Solution in Python:
assistant
#Here is code to program to print the series 1 , 3 , 4 , 8 , 15 , 27 , 50 â €¦ till N terms and the other steps required.
 def printSeries ( n , a , b , c ) :
	if ( n == 1 ) :
		print ( a , end = " ▁ " ) ;
		return ;
	if ( n == 2 ) :
		print ( a , b , end = " ▁ " ) ;
		return ;
	print ( a , b , c , end = " ▁ " ) ;
	for i in range ( 4 , n + 1 ) :
		d = a + b + c ;
		print ( d , end = " ▁ " ) ;
		a = b ;
		b = c ;
		c = d ;
N = 7 ; a = 1 ; b = 3 ;
c = 4 ;
printSeries ( N , a , b , c ) ;