human
Queries on sum of odd number digit sums of all the factors of a number | Python Program to answer queries on sum of sum of odd number digits of all the factors of a number.
finding sum of odd digit number in each integer ..
for each number.
using previous number sum , finding the current number num of odd digit also , adding last digit if it is odd ..
finding sum of sum of odd digit of all the factors of a number ..
for each possible factor.
adding the contribution ..
Wrapper def.
Driver Code"
Solution in Python:
 ... What is a code to queries on sum of odd number digit sums of all the factors of a number and the other steps required?
assistant
#Here is code to queries on sum of odd number digit sums of all the factors of a number and the other steps required.
 N = 100
digitSum = [ 0 ] * N
factorDigitSum = [ 0 ] * N
def sumOddDigit ( ) :
	global N , digitSum , factorDigitSum
	for i in range ( 1 , N ) :
		digitSum [ i ] = ( digitSum [ int ( i / 10 ) ] + int ( i & 1 ) * ( i % 10 ) )
def sumFactor ( ) :
	global N , digitSum , factorDigitSum
	j = 0
	for i in range ( 1 , N ) :
		j = i
		while ( j < N ) :
			factorDigitSum [ j ] = ( factorDigitSum [ j ] + digitSum [ i ] )
			j = j + i
def wrapper ( q , n ) :
	global N , digitSum , factorDigitSum
	for i in range ( 0 , N ) :
		digitSum [ i ] = 0
		factorDigitSum [ i ] = 0
	sumOddDigit ( )
	sumFactor ( )
	for i in range ( 0 , q ) :
		print ( " { } ▁ " . format ( factorDigitSum [ n [ i ] ] ) , end = " " )
q = 2
n = [ 10 , 36 ]
wrapper ( q , n )