human
Sum of the natural numbers ( up to N ) whose modulo with K yield R | Function to return the sum.
If current number gives R as the remainder on dividing by K.
Update the sum.
Return the sum.
Driver code"
Solution in Python:
 ... Can you provide a code to sum of the natural numbers ( up to N ) whose modulo with K yield R and the other steps required?
assistant
#Here is code to sum of the natural numbers ( up to N ) whose modulo with K yield R and the other steps required.
 def count ( N , K , R ) :
	sum = 0
	for i in range ( 1 , N + 1 ) :
		if ( i % K == R ) :
			sum += i
	return sum
if __name__ == ' _ _ main _ _ ' :
	N = 20
	K = 4
	R = 3
	print ( count ( N , K , R ) )