Let x,y be distinct integers with 1≤x≤25, 1≤y≤25. The number of ways of choosing x,y such that x+y is divisible by 5 is \_\_\_\_.
Answer: 120
Solutions · 1
Official solution
Each residue class mod 5 (1--5, 6--10, ..., 21--25) contains 5 numbers. x+y divisible by 5 requires residues summing to 0 mod 5: pairs within the same class (residue 0 with 0) or complementary classes (1\&4, 2\&3).
Counting ordered pairs with x=y: for residue-0 class: 5×4=20; for each complementary pair of classes: 5×5×2=50 (two such complementary pairs: 1--4, 2--3), giving 50×2=100.
Total =20+100=120.