Take the function
$$ f(x) = 2x+1 $$
Is there a method to find when a specific prime, like $5$, is the largest prime factor of the function?
What I have done to try to solve this is by realizing that when,
$$ x = 10n+7 $$
For $ n \in \mathbb{N} $ then $ 5 \mid f(x)$, but $ 5 $ isn't neccesarily the largest prime factor of $ f(x) $ for any $n$.
This then transforms our $ f(x) \rightarrow f(n) $ where
$$ f(n) = 20n + 15 $$
We can also see that when $ 5 $ is the largest prime factor of $f(n)$ then $3 \mid f(n)$ which means,
$$ 5(4n+3) = 3^a*5^b $$
For $ a \in \mathbb{N}$ and $ b \in \mathbb{N} $. Simplifying,
$$ 4n+3 = 3^a*5^{b-1} $$
$ 5 $ is the largest prime factor of $ f(n) $ when $ n = \{ 0,3,6,18\} $, but there doesn't seem to be a direct pattern to when $ n $ is equal to some number and when $ 5 $ is the largest prime factor of $ f(n) $. This would also mean that $ n \subset \mathbb{N}$.
By sieve of sundaram logic ( also logic like polynomial remainder theorem) is $r=2a+1$ divides $2x+1$ when $x=rb+a$ for some value $b\in \mathbb{N}$ we then have to eliminate values that have higher factors. in the case of $5=2(2)+1$ ;$x$ needs to be 2 mod 5, but can't be 3 mod 7, 5 mod 11, 6 mod 13, 8 mod 17, 9 mod 19, 11 mod 23, or 14 mod 29 just for starters. first two intersect in 17 mod 35, so that's out. This leaves 2,7,12,22,27,32 mod 35, which intersect the next one above at ( respectively) 247,357,82,302,27,137, mod 385, etc. this at least lets us clear up to a limit of $x$ values. You can generalize to any multiplicative group as well, so for odd number values trying to sieve odd semiprimes, just use the values $m$ such that $6m+1$ or $6m+5$ can't be primes and sieve prime indexes after that. You can limit $a,b$ to show if it has too high of factors.