Sometimes setting up the equation is the hardest part. Starting gallons minus (leaking gallons times number of leaking weeks) equal to the other tank, same setup.
657 - 4w = 876 - 7w
3w = 219
w = 73
Checking the math:
657 - 4(73) = 365
876 - 7(73) = 365
73 weeks