Is a pattern proof? Let's say I want a formula that takes any number and makes it into 170, and I come up with a formula that I think does it. If I plug 1 into it, 2 into it, 3 into it, etc. up to a pretty large number and it works, can I call the formula proven? 
 A: No. Consider the famous quadratic polynomial 
$$
P(n) = n^2+n+41
$$
that Euler first noticed in 1772. Does this polynomial generate all prime numbers? Try plugging in any natural number less than $40$ and you may be convinced, but ah...what about when you plug in $n=40$? Sad day. 
A: If you know enough about the structure your function (ex. that it is a polynomial of some fixed degree n), then knowing a large number of points may be enough to determine it.
For example, perhaps my function is of the form $f(x) = ax^2 + bx + c$, and I know $f(0) = 0$, $f(1) = 0$, $f(2) = 0$. Then this enough to determine $f$ by algebraically solving for the coefficients a, b and c.
However, by allowing the degree of the polynomial to be large, we could write down infinitely many polynomial functions taking the same values on a finite set of points. So in general one really has to know a lot to determine a function by testing a few values.
A: No. It quite fits the classic joke about the physicists, for whom that would be enough to call it proved, against the mathematicians which need a complete proof.
There are some nice examples (i'll try to recall them asap) of such formulas which are correct for billions of consequitive natural numbers, yet fail at some point.
A (but not only) correct way of proving such formula (assuming you are interested in a proof for all natural numbers, but not more) is mathematical induction - you should read about it.
A more general concept is transfinite induction that can help prove such formulas for any well-ordered set.
A: No, it is never enough to check a number of examples, unless of course there are a finite number of cases. Check out this previous question for many examples of exactly this problem.
A: This remind me of an old joke that "how academics prove all odd numbers are primes", where part of the joke say a statistician prove the statement by "'randomly' choose 47, which is prime; choose 89, which is prime, choose 101, which is prime. Therefore all odd numbers are primes".
Applying many cases to see whether they work is a common start. This gives you evidence that "probably this statement is true". Also applying some cases may provide you some ideas about how a statement can be proved. Notice the word "probably", maybe you tried hard, but it is possible that you have bad luck. For example, Fermat number. Fermat found that first 5 numbers of the sequences are prime. At his era, it was a hard work without the help of computer. However, the 6$^\text{th}$ one is not prime.
However, I believe your intuition still has some value. Somehow your idea has some relation with mathematical induction. If you simply apply $1,2,3,\dots$, you cannot do this infinite times. However, induction is like you want to show that you can go to any step of an infinite stair. First you prove that you can go to the first step. Then you prove that if you are at $n$th step, you can make one more move and go to the next step. Therefore you can go to any stair. This analogy is not very rigorous, (if an analogy is perfect, why do we need definition?) but I believe it intuitively works very well.
Hope this can help you.
A: No, it's not, because in some cases the pattern might fail precisely after the point you stop looking. The pattern might also fail where you fail to look. Given $n \in \mathbb{Z}$, consider this function: $$f(n) = \lfloor \sin n \rfloor + \left\lceil \frac{n \pmod 6}{2} \right\rceil - \delta_0^{n \pmod 3} + 13^2.$$ (Here $n$ is assumed to be radians, and $\delta$ is the infamous Kronecker delta function). This works for $0 < n < 5$. It also works for $n = 10^7$. But $f(5) = 172$. In fact, $f(n)$ fluctuates around 170.
Here's a much simpler one: $f(x) = x^0 + 13^2$. As long as $x \neq 0$, we'll have $f(x) = 170$. It should be relatively easy to prove this is true without having to go through the calculations with any specific value of $x$.
Remember: a single counterexample is enough to disprove, but a trillion examples are not enough to prove.
A: A mathematician will say what he means and will mean what he says. If he says "this formula maps all natural numbers to 170" then it means that the mathematician can prove that the formula maps /all natural numbers/ to 170.
As another example, when a mathematician says "there is no general formula for the solution of an arbitrary fifth degree polynomial" he doesn't mean that "we haven't found one yet." It means that he can prove that the thing does not exist.
We never present any claims as true unless we can prove it in mathematics, that is, prove /exactly what we said/ from deductive logic.
A: Here's a very contrived example: $$f(n) = \Big\lfloor \frac{\pi(n)}{10^7} \Big\rfloor + 170,$$ where $\pi(x)$ is the prime counting function. You'd have to go above $n = 179424672$ to find a counterexample. Of course "$f(n) = 170$ always" is easy enough to disprove if you know that there are infinitely many prime numbers, so it requires very little actual computation to disprove.
A: You can think of this probabilistically. Let's say I want to test a hypothesis (you can think of any real world example, such as drug testings) and I want to make sure that I'm right in at least $p\% > 0$ cases to be satisfied. But, if I have some statement about natural numbers (or some infinite subset of natural numbers) and I check it to be true for all the numbers lesser than some large $n$, I am still $0\%$ sure my statement is correct since $\frac n \infty = 0$. No matter how many different numbers you check, ultimately you didn't catch even a tiny fraction. That is why we use deductive reasoning in mathematics, not empirical experiments.
A: No you can't... A classical example of such mistake:

3,5,7 are prime numbers and so every odd number is prime

See also this question for much more counter-examples.
