The maximum and minimum values of f are 1334 and 668, respectively.
a. First, we will show that the maximum value of f is 1334. The set S={1,2,…,667}∪{1336,1337,…,2002} is a skipping set for (a,b)=(667,668), so f(667,668)≥1334.
Now we prove that for any 0<a<b<1000, f(a,b)≤1334. Because a=b, we can choose d∈{a,b} such that d=668. We assume first that d≥669. Then consider the 2003−d≤1334 sets {1,d+1},{2,d+2},…,{2003−d,2003}. Each can contain at most one element of S, so ∣S∣≤1334.
We assume second that d≤667 and that ⌈a2003⌉ is even, that is, ⌈a2003⌉=2k for some positive integer k. Then each of the congruence classes of 1,2,…,2003 modulo a contains at most 2k elements. Therefore at most k members of each of these congruence classes can belong to S. Consequently,
∣S∣≤ka<21(a2003+1)a=22003+a≤1335,
implying that ∣S∣≤1334.
Finally, we assume that d≤667 and that ⌈a2003⌉ is odd, that is, ⌈a2003⌉=2k+1 for some positive integer k. Then, as before, S can contain at most k elements from each congruence class of {1,2,…,2ka} modulo a. Then
∣S∣≤ka+(2003−2ka)=2003−ka=2003−(2⌊a2003⌋−1)a≤2003−(2a2003−1)a=22003+a≤1335.
The last inequality holds if and only if a=667. But if a=667, then a2003 is not an integer, and so the second inequality is strict. Thus, ∣S∣≤1334. Therefore the maximum value of f is 1334.
b. We will now show that the minimum value of f is 668. First, we will show that f(a,b)≥668 by constructing a skipping set S for any (a,b) with ∣S∣≥668. Note that if we add x to S, then we are not allowed to add x, x+a, or x+b to S at any later time. Then at each step, let us add to S the smallest element of {1,2,…,2003} that is not already in S and that has not already been disallowed from being in S. Then since adding this element prevents at most three elements from being added at any future time, we can always perform this step ⌈32003⌉=668 times. Thus, ∣S∣≥668, so f(a,b)≥668.
Now notice that if we let a=1,b=2, then at most one element from each of the 668 sets {1,2,3},{4,5,6},…,{1999,2000,2001},{2002,2003} can belong to S. This implies that f(1,2)=668, so indeed the minimum value of f is 668.