human
Digit | function to produce and print Digit Product Sequence.
Array which store sequence.
Temporary variable to store product.
Initialize first element of the array with 1.
Run a loop from 1 to N . Check if previous number is single digit or not . If yes then product = 1 else take modulus . Then again check if previous number is single digit or not if yes then store previous number , else store its first value Then for every i store value in the array ..
Print sequence.
Value of N.
Calling function"
Solution in Python:
assistant
#Here is code to digit and the other steps required.
 def digit_product_Sum ( N ) :
	a = [ 0 ] * ( N + 1 ) ;
	product = 1 ;
	a [ 0 ] = 1 ;
	for i in range ( 1 , N + 1 ) :
		product = int ( a [ i - 1 ] / 10 ) ;
		if ( product == 0 ) :
			product = 1 ;
		else :
			product = a [ i - 1 ] % 10 ;
		val = int ( a [ i - 1 ] / 10 ) ;
		if ( val == 0 ) :
			val = a [ i - 1 ] ;
		a [ i ] = a [ i - 1 ] + ( val * product ) ;
	for i in range ( N ) :
		print ( a [ i ] , end = " ▁ " ) ;
N = 10 ;
digit_product_Sum ( N ) ;