Solution:
We first prove the following lemma, which will be useful later.
Lemma: Let p be a prime and 1≤n≤p−1 be an integer. Then, n!(p−1−n)!≡(−1)n−1(modp).
Proof. Write
n!(p−n−1)!=(1⋅2⋯n)((p−n−1)⋯2⋅1)≡(−1)p−n−1(1⋅2⋯n)((n+1)⋯(p−2)(p−1))(modp)=(−1)n(p−1)!≡(−1)n−1(modp)
(where we have used Wilson's theorem). This implies the result.
Now, we begin the solution. Suppose that a prime p divides both a⋅n!−1 and a⋅(n+1)!+b. Then, since
−b≡a⋅(n+1)!≡(n+1)⋅(a⋅n!)≡(n+1)(modp)
we get that p∣n+b+1. Since we must have n<p (or else p∣n! ), we get that, for large enough n, n=p−b−1. However, by the lemma,
a(−1)b−1≡a⋅b!(p−1−b)!=a⋅b!n!≡b!(modp)
This must hold for infinitely many p, so a=(−1)b−1b!. This forces all fantastic pairs to be in form ((2k−1)!,2k−1).
Now, we prove that these pairs all work. Take n=p−2k for all large primes p. Then, we have
a⋅n!a⋅(n+1)!≡(2k−1)!(p−2k)!≡(−1)2k≡1(modp)≡(n+1)⋅(a⋅n!)≡(p−2k+1)⋅1≡−(2k−1)(modp)
so p divides the gcd.
The answer is (1+1)+(6+3)+(120+5)+(5040+7)=5183.