OFFSET
1,2
COMMENTS
Only odd primes are considered since the conditions could not be satisfied for prime 2; i.e., cannot find a k which avoids i^2 + k divisible by 2 over all integers i.
The conditions are that -k is not a quadratic residue mod any of the first n odd primes.
Each odd prime has one or more quadratic non-residues and the Chinese Remainder Theorem can assemble combinations of them to find candidate k values, of which a(n) is the smallest.
The sequence is weakly increasing a(n+1) >= a(n) since each additonal odd prime adds a residue class condition.
Equality a(n) = a(n+1) = k occurs when k already satisfies the additional condition at n+1; i.e., -k is already a non-residue mod prime(n+1).
a(n) can be estimated by (Product_{i=2..n} prime(i)) / (Product_{i=2..n} (prime(i)-1)/2).
This formula works because (prime(i) - 1) / 2 is the number of quadratic residues modulo prime(i), so total possible residue combinations over the acceptable combinations.
As an observation, most values of k tend to be odd. This might be because the absence of factors in a number tends to favor the properties that k must satisfy. Since this seems to be the case, odd numbers can utilize the full list of primes among their potential values for k, while even numbers will always have at least 2 as a factor, thus contributing to the generally undesired compositeness of k.
EXAMPLE
For n=1, the first 1 odd prime is 3 and a(1) = k = 1 has i^2 + 1 never divisible by 3.
For n=3, the first 3 odd primes are {3,5,7} and a(3) = k = 22 has i^2 + 22 never divisible by any of 3,5,7.
As we progress further along the sequence, the values of k tend to grow significantly, such as a(43) = 1065437749777.
For n=4, the estimate formula is (3*5*7*11) / (1*2*3*5) = 38.5 as compared to the actual a(4) = 37.
CROSSREFS
KEYWORD
nonn
AUTHOR
Jesus Pineiro Sanchez, Oct 16 2024
STATUS
approved