m/n=m/(2005-m) because m+n=2005.
m/n<16/23, m/(2005-m)<16/23,
23m<16(2005-m), 23m<32080-16m, 39m<32080, m<32080/39.
32080/39=822.56 approx., therefore m≤822.
When m=822, n=1183, m/n=822/1183<16/23 and is the largest fraction in f which is less than 16/23.
(n-m)/6=(1183-822)=361/6.