### Instruction: For how many ordered pairs of positive integers $(x,y),$ with $y<x\le 100,$ are both $\frac xy$ and $\frac{x+1}{y+1}$ integers?
 Please write a program to solve it.### Response: # The problem asks for pairs of positive integers (x, y) with y < x <= 100 such that both x/y and (x+1)/(y+1) are integers.

def count_pairs(n):
    count = 0
    # iterate for all values of x from 2 to n
    for x in range(2, n+1):
        # iterate for all values of y from 1 to x-1
        for y in range(1, x):
            # check if both x/y and (x+1)/(y+1) are integers
            if x % y == 0 and (x+1) % (y+1) == 0:
                count += 1
    return count

print(count_pairs(100))