human
Check whether given number N is a Moran Number or not | Function to calculate digit sum.
Function to check if number is prime.
Function to check if number is moran number.
Calculate digit sum.
Check if n is completely divisible by digit sum.
Calculate the quotient.
Check if the number is prime.
Driver code"
Solution in Python:
assistant
#Here is code to check whether given number N is a Moran Number or not and the other steps required.
 def digSum ( a ) :
	_sum = 0
	while ( a ) :
		_sum += a % 10
		a = a // 10
	return _sum
def isPrime ( r ) :
	s = True
	i = 2
	while i * i <= r :
		if ( r % i == 0 ) :
			s = False
			break
		i += 1
	return s
def moranNo ( n ) :
	dup = n
	_sum = digSum ( dup )
	if ( n % _sum == 0 ) :
		c = n // _sum
		if ( isPrime ( c ) ) :
			print ( " Yes " )
			return
	print ( " No " )
n = 21
moranNo ( n )