We define f(x)=x2−3x+13 and note that f(x)=(x−3)x+13=13−x(3−x) from which we easily discover that f(3−x)=f(x) for all x. Calculating f(0)=13 and f(1)=11, we see that the smallest prime p that divides f(n) for some n is at most 11. We may finish in two different ways.
Way 1. Because f(n)≡f(m)(modp) when n≡m(modp), it is sufficient to calculate f(n)(modp) for p consecutive values of n. We only need to do this for p∈{2,3,5,7} in order to determine whether 11 is the smallest prime we are looking for. Because f(3−n)=f(n), we have f(2)=f(1)=11, f(3)=f(0)=13 and f(4)=f(−1)=17. Finally, f(−2)=23 and we see that f(n)≥11 is a prime for each of the seven consecutive values n=−2,−1,0,1,2,3,4. Hence, the smallest prime number that divides f(n) for at least one n is p=11.
Way 2. For each p∈{2,3,5,7} we discuss f(n)(modp) separately.
f(n)=n2−3n+13≡n2−n+1≡1(mod2)
because n2≡n(mod2) for all integers n by Fermat's Little Theorem.
f(n)=n2−3n+13≡n2−2≡0(mod3)
because squares of integers can only be congruent to 0 or 1 modulo 3.
f(n)=n2−3n+13≡n2+2n+3≡(n+1)2+2≡0(mod5)
because squares of integers can only be congruent to 0 or ±1 modulo 5.
f(n)=n2−3n+13≡n2+4n+6≡(n+2)2+2≡0(mod7)
because squares of integers can only be congruent to 0, 1, 2 or 4 modulo 7. Hence, for no integer n is f(n) divisible by 2, 3, 5 or 7. The smallest prime number that divides f(n) for at least one n therefore is p=11.