Why is linear regression not able to predict the outcome of a simple deterministic sequence? A colleague of mine sent me this problem apparently making the rounds on the internet:
If $3 = 18, 4 = 32, 5 = 50, 6 = 72, 7 = 98$, Then, $10 =$ ?

The answer seems to be 200.
3*6  
4*8  
5*10  
6*12  
7*14  
8*16  
9*18  
10*20=200  

When I do a linear regression in R:
data     <- data.frame(a=c(3,4,5,6,7), b=c(18,32,50,72,98))  
lm1      <- lm(b~a, data=data)  
new.data <- data.frame(a=c(10,20,30))  
predict  <- predict(lm1, newdata=new.data, interval='prediction')  

I get:   
  fit      lwr      upr  
1 154 127.5518 180.4482  
2 354 287.0626 420.9374  
3 554 444.2602 663.7398  

So my linear model is predicting $10 = 154$.
When I plot the data it looks linear... but obviously I assumed something that is not correct.
I'm trying to learn how to best use linear models in R. What is the proper way to analyze this series? Where did I go wrong?
 A: A regression model, such as the one fit by lm() implicitly assumes that the underlying data generating process is probabilistic.  You are assuming that the rule you are trying to model is deterministic.  Therefore, there is a mismatch between what you are trying to do and the way you are trying to do it.  
There are other software (i.e., not R) that is explicitly designed to find / fit the simplest function to deterministic data (an example would be Eureqa).  There may be an R package for that (that I don't know of), but R is intended for statistical modeling of probabilistic data.  
As for the answer that lm() gave you, it looks reasonable, and could be right.  However, I gather the context in which this problem was presented strongly implied that it should be understood as deterministic.  If that hadn't been the case, and you were wondering if the fit was reasonable, one thing you might notice is that the two extreme data points are above the regression line, while the middle data are all below it.  This suggests a mis-specified functional form.  This can also be seen in the residuals vs. fitted plot (plot(lm1, which=1):  

As for the model fit by @AlexWilliams, it looks much better:  

A: The trend is quadratic not linear. Try:
lm1 <- lm(b~I(a^2), data=data)

Update: Here is the code.
data <- data.frame(a=c(3,4,5,6,7),b=c(18,32,50,72,98))
lm1 <- lm(b~I(a^2), data=data)
new.data <- data.frame(a=c(10,20,30))
predict(lm1, newdata = new.data, interval='prediction')

And output:
   fit  lwr  upr
1  200  200  200
2  800  800  800
3 1800 1800 1800

A: I hesitate to add to the excellent answers given by Alex Williams and gung, but there is a further point that should I think be made.  The question uses the phrases 'linear regression' and 'linear model', possibly suggesting that they mean the same. However, the usual meaning of 'linear regression' refers to the Classical Linear Regression Model (CLRM) in which 'linear' means 'linear in the parameters'. This is a condition on the parameters, not on the independent variables.  So a quadratic model such as:
$$Y_i = \beta_1 + \beta_2X_i^2$$
is still linear in the sense of CLRM, because it is linear in the parameters $\beta_1$ and $\beta_2$. By contrast, the model:
$$Y_i = \beta_1 + \beta_2X_i$$
is linear in its parameters and also linear in $X_i$. Rather than calling it a linear model, a more precise statement is that it is linear in its parameters and has linear functional form. So it can be said that the series can be analysed by a model that is linear in its parameters, provided it has quadratic functional form (as shown by Alex Williams), but not by a model having linear functional form. 
