TITLE: Smallest number of primes
QUESTION [5 upvotes]: Let $P$ be a set of primes, such that for each nonnegative integer $n$, $19⋅8^n+17$ is divisible by some prime $p$ in $P$. Find the smallest possible number of elements in $P$. How do I start the problem? Thanks.

REPLY [6 votes]: The smallest possible number of elements in $P$ is $3$, with $P=\{3,5,13\}$:

$n\equiv0\pmod4\implies 3|19\cdot8^n+17$
$n\equiv1\pmod4\implies13|19\cdot8^n+17$
$n\equiv2\pmod4\implies 3|19\cdot8^n+17$
$n\equiv3\pmod4\implies 5|19\cdot8^n+17$

Let's prove each one of these statements by induction.

First, show that this is true for $n=0$:

$\small{19\cdot8^{0}+17= 3\cdot  12}$
$\small{19\cdot8^{1}+17=13\cdot  13}$
$\small{19\cdot8^{2}+17= 3\cdot 411}$
$\small{19\cdot8^{3}+17= 5\cdot1949}$

Second, assume that this is true for $n$:

$\small{19\cdot8^{4n+0}+17= 3a}$
$\small{19\cdot8^{4n+1}+17=13b}$
$\small{19\cdot8^{4n+2}+17= 3c}$
$\small{19\cdot8^{4n+3}+17= 5d}$

Third, prove that this is true for $n+1$:

$\small{19\cdot8^{4n+4}+17=4096\cdot(\color{red}{19\cdot8^{4n+0}+17})-69615=4096\cdot\color{red}{ 3a}-69615= 3\cdot(4096a-23205)}$
$\small{19\cdot8^{4n+5}+17=4096\cdot(\color{red}{19\cdot8^{4n+1}+17})-69615=4096\cdot\color{red}{13b}-69615=13\cdot(4096b- 5355)}$
$\small{19\cdot8^{4n+6}+17=4096\cdot(\color{red}{19\cdot8^{4n+2}+17})-69615=4096\cdot\color{red}{ 3c}-69615= 3\cdot(4096c-23205)}$
$\small{19\cdot8^{4n+7}+17=4096\cdot(\color{red}{19\cdot8^{4n+3}+17})-69615=4096\cdot\color{red}{ 5d}-69615= 5\cdot(4096d-13923)}$


The smallest possible number of elements in $P$ is $3$ because:

The base-cases show that there must be at least $3$ elements in $P$
The induction-steps show that the elements $3,5,13$ are sufficient