human
Find if a number is part of AP whose first element and difference are given | '' returns yes if exist else no. .
If difference is 0 , then x must be same as a ..
Else difference between x and a must be divisible by d ..
Driver code"
Solution in Python:
assistant
#Here is code to find if a number is part of AP whose first element and difference are given and the other steps required.
 def isMember ( a , d , x ) :
	if d == 0 :
		return x == a
	return ( ( x - a ) % d == 0 and int ( ( x - a ) / d ) >= 0 )
a = 1
x = 7
d = 3
if isMember ( a , d , x ) :
	print ( " Yes " )
else :
	print ( " No " )