The important word in my assertion isn't mathematical, it's predict. You cannot determine the closest prime p to any number n without a primality test. Now, brute force algorithms are mathematically describable; I'm not saying they're not.

Let me give you another example. Can you tell me the closest power of 2 to a given number N? Now, can you do it without breaking down a number into its composite primes? I can, by generating the sequence of powers of 2 and looking at them. That's predictive.

Here's pseudocode for both algorithms, so you can see the difference.

Brute-force algorithm:
sub is_power {
# Some algorithm to determine if a number is a power of two.
}
sub closest_power_of_two_brute {
my $m = my $n = shift;
return $n if is_power( $n, 2 );
while (1) {
return $n if is_power( $++n, 2 );
return $m if is_power( $--m, 2 );
}
}

Being right, does not endow the right to be rude; politeness costs nothing. Being unknowing, is not the same as being stupid. Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence. Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.