The highest prime factor of neighboring numbers I think it's easiest to explain this challenge in a sequential manner. Start with an input number \$N\$ and:

Find its highest prime factor
Check numbers above and below \$N\$ and see if the highest prime factor is higher (i.e. the highest prime factor of \$N-1\$ and/or \$N+1\$ is higher than the factor of \$N\$.
Continue to check higher and/or lower numbers neighboring \$N\$ in the directions where the highest factors are increasing (\$(N-2, N-3 ...)\$ and/or \$(N+2, N+3 ...)\$ and so on)
Once there aren't any prime factors in either direction that are higher than the ones we've already found we stop and output the highest prime factor we have encountered.

Let's look at an example:
245 has the prime factors 5, 7, 7. Its neighbors are:
244 -&gt; 2,  2,  61
245 -&gt; 5,  7,  7
246 -&gt; 2,  3,  41

The highest prime factor is increasing in both direction, so we must look at the next neighbor:
243 -&gt; 3,   3,  3,  3,  3
244 -&gt; 2,   2,  2,  61
245 -&gt; 5,   7,  7
246 -&gt; 2,   3,  41
247 -&gt; 13,  19

The highest prime factors are now decreasing in both direction, so the highest prime factor we've encountered is 61, and should therefore be returned.
Another example:
Let's look at 1024. Its prime factors are 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.
The prime factors of its nearest neighbors are:
1023 -&gt; 3, 11, 31
1024 -&gt; 2,  2,  2,  2,  2,  2,  2,  2,  2,  2
1025 -&gt; 5,  5, 41

The highest prime factor are increasing in both direction, from 2 to 31 or 41. Let's look at the neighbors:
1022 -&gt; 2, 7,  73
1023 -&gt; 3, 11, 31
1024 -&gt; 2,  2,  2,  2,  2,  2,  2,  2,  2,  2
1025 -&gt; 5,  5, 41
1026 -&gt; 2,  3,  3, 19

The highest prime factor for 1022 is 73, and the highest prime factor for 1026 is 19. Since 19 is lower than 41 we're not interested in it. It's still increasing for numbers smaller than \$N\$, so we'll check the next one in that direction:
1021 -&gt; 1021
1022 -&gt; 2, 7,  73
1023 -&gt; 3, 11, 31
1024 -&gt; 2,  2,  2,  2,  2,  2,  2,  2,  2,  2
1025 -&gt; 5,  5, 41
1026 -&gt; 2,  3,  3, 19

1021 is a prime, and the highest prime we've encountered, so it should be returned.
Rules:

You will only get positive \$N\$ larger than \$1\$ and smaller than \$2^{31}-2\$.
Input and output formats are optional, but the numbers must be in base 10.
You should continue searching for higher primes as long as the highest value is increasing in that direction. The directions are independent of each other.

Test cases:
Format: N, highest_factor
2, 3
3, 3
6, 7
8, 11
24, 23 
1000, 997
736709, 5417 
8469038, 9431
Mathematica, 82 74 bytes

Thanks to Martin Ender for saving 8 bytes!

Max@@(±n_:=#//.x_/;l[t=x+n]&gt;l@x:&gt;t;l=FactorInteger[#][[-1,1]]&amp;)/@{±-1,±1}&amp;


Unnamed function taking an integer input and returning an integer.

±n_:=#//.x_/;l[t=x+n]&gt;l@x:&gt;t defines a unary function ± which keeps increasing the global function's integer input by n as long as the largest prime factor is increasing. (The largest-prime-factor function is defined with l=FactorInteger[#][[-1,1]]&amp;.) {±-1,±1} therefore applies that function twice to the input integer, with increment -1 and again with increment 1. Then, Max@@(...l...)/@... takes the larger of the two largest-prime-factors thus found.

Previous submission:

Max@@(l=FactorInteger[#][[-1,1]]&amp;)/@(#//.x_/;l[t=x+#2]&gt;l[x]:&gt;t&amp;@@@{{#,-1},{#,1}})&amp;