It's not hard to show that the value of the largest 4-digit number in this series is 99 x 101 = 9999. But as for the value of n, hmmm... I need to think about it.
EDIT - OK, I thought about it, and I believe the value of n is 99+101-2 = 198.
The first step is to find the value the prime to use - it's either the largest prime whose square <= 10000, or the next higher prime after that. In this case the square root of 10000 = 100, so it's either 97 or 101. Since 97x101 = 9797, and we can continue to add 101's to it and still stay under 10000, the prime to use is 101. Next: 10000/101 = 99.0099, so the second factor is 99.