human
Print the sequence of size N in which every term is sum of previous K terms | Function to generate the series in the form of array.
Pick a starting point.
Find the sum of all elements till count < K.
Find the value of sum at i position.
Driver Code"
Solution in Python:

Can you provide a code to print the sequence of size N in which every term is sum of previous K terms and the other steps required?
assistant
#Here is code to print the sequence of size N in which every term is sum of previous K terms and the other steps required.
 def sumOfPrevK ( N , K ) :
	arr = [ 0 for i in range ( N ) ]
	arr [ 0 ] = 1
	for i in range ( 1 , N ) :
		j = i - 1
		count = 0
		sum = 0
		while ( j >= 0 and count < K ) :
			sum = sum + arr [ j ]
			j = j - 1
			count = count + 1
		arr [ i ] = sum
	for i in range ( 0 , N ) :
		print ( arr [ i ] )
N = 10
K = 4
sumOfPrevK ( N , K )