I found that
$(671n \mod 2454) + (304n \mod 32) + (4373n \mod 199)$
generates $38$ distinct primes for $n=1$ to $38$: $881, 1531, 2213, 409, 1091, 1741, 2423, 619, 1301, 1951, 179, 829, 1511, 2161, 389, 1039, 1721, 2371, 599, 1249, 1931, 127, 809, 1459, 2141, 337, 1019, 1669, 2351, 547, 1229, 1879, 107, 757, 1439, 2089, 317, 967.$
Is this anything unusual and is there a good explanation for it? Is there a function of the same form that generates more consecutive terms of distinct primes? The function must be of the form $\sum_{i}(A_in \mod B_i)$, where all $A_i, B_i$ are positive integers.