MathLabs

Problem 4

A set of positive integers is called fragrant if it contains at least two elements and each of its elements has a prime factor in common with at least one of the other elements. Let P(n)=n2+n+1P(n)=n^2+n+1. What is the smallest possible value of a positive integer bb such that there exists a non-negative integer aa for which the set {P(a+1),P(a+2),…,P(a+b)}\{P(a+1),P(a+2),\dots,P(a+b)\} is fragrant?
Step 1 of 5: Four sharp Euclidean-algorithm bounds
In plain words

Since P(n+d)−P(n)P(n+d)-P(n) is a simple polynomial in nn and dd, running the Euclidean algorithm on P(n)P(n) and this difference pins down the gcd to a small fixed divisor depending only on dd.

gcd⁡(P(n),P(n+1))=1,  gcd⁡(P(n),P(n+2))∣7,  gcd⁡(P(n),P(n+3))∣3,  gcd⁡(P(n),P(n+4))∣19\gcd(P(n),P(n{+}1))=1,\ \ \gcd(P(n),P(n{+}2))\mid7,\ \ \gcd(P(n),P(n{+}3))\mid3,\ \ \gcd(P(n),P(n{+}4))\mid19
Detailed analysis

Since P(n)=n2+n+1P(n)=n^2+n+1, one computes P(n+d)−P(n)=d(2n+d+1)P(n+d)-P(n)=d(2n+d+1) for each gap dd. Running the Euclidean algorithm (eliminating nn using P(n)≡0P(n)\equiv0) shows gcd⁡(P(n),P(n+1))=1\gcd(P(n),P(n+1))=1, gcd⁡(P(n),P(n+2))∣7\gcd(P(n),P(n+2))\mid7, gcd⁡(P(n),P(n+3))∣3\gcd(P(n),P(n+3))\mid3, and gcd⁡(P(n),P(n+4))∣19\gcd(P(n),P(n+4))\mid19, for all integers nn.