Check every quadruplet pair whether its gcd is k
for u in range ( l , r + 1 , 1 ) : NEW_LINE INDENT for v in range ( l , r + 1 , 1 ) : NEW_LINE INDENT for w in range ( l , r + 1 , 1 ) : NEW_LINE INDENT for x in range ( l , r + 1 , 1 ) : NEW_LINE INDENT if ( gcd ( gcd ( u , v ) , gcd ( w , x ) ) == k ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT DEDENT DEDENT DEDENT DEDENT