TITLE: A ring such that all projectives are stably free but not all projectives are free? 
QUESTION [19 upvotes]: This question is motivated by this recent question. Suppose $R$ is commutative, Noetherian ring and $M$ a finitely generated $R$-module. Let $FD(M)$ and $PD(M)$ be the shortest length of free and projective resolutions (with all modules f.g.)  of $M$ respectively. 
We will be interested in two conditions on $R$:
(1) For all f.g. $M$, $PD(M)<\infty$ if and only if $FD(M)<\infty$.
(2) For all f.g. $M$, $PD(M)=FD(M)$. 
It is not hard to see that one is equivalent to (3): all f.g. projective modules are stably free. Also, (2) is equivalent to (4): all f.g projectives are free. It is natural to ask whether (1) and (2) are equivalent. I don't think they are, but can't find a counter-example. Thus:

Can we find a commutative Noetherian ring which satisfies (3) but not (4)?  

Some thoughts: (3) is equivalent to the Grothendick group of projective $K_0(R)=\mathbb Z$. Well-known class of rings satisfying (3): local rings or polynomial rings over fields. 
Of course, there are well known rings which fails (4): coordinate rings of $n$-spheres $R_n=\mathbb R[x_0,\cdots,x_n]/(x_0^2+\cdots+x_n^2-1)$ for $n$ even. Unfortunately, for those rings we have $K_0(R_n)=\mathbb Z^2$. (except for $n=8r+6$ which do provide examples, see below)
UPDATE: it seems to me that Tyler's answer suggests $R_5$ may work, but one needs to check some details. 
UPDATE 2: I think one can put together a more or less complete solution, based on Tyler and Torsten's answers, the comments and some digging online. 
Claim: $R_n$ satisfies (3) but not (4) if $n=5,6$ or $n=8r+k$ with $r>0$, $k\in \{3,5,6,7\}$ 
Proof: Let $S^n$ be the $n$-sphere and $C(S^n)$ be the ring of continuous functions.
To show that $R_n$ satisfies (3), it suffices to show $K_0(R_n)=\mathbb Z$ (Lemma 2.1, Chapter 2 of Weibel's K-book) or the reduced group $\tilde K_0(R_n)=0$. But one has isomorphism (known to Swan, see for example 5.7 of this paper):
$$\tilde K_0(R_n) \cong \tilde KO_0(S^n) $$
the reduced $K$-groups of real vector bundles, and it is well-known that $\tilde KO_0(S^n) =0$ if $n\equiv 3,5,6,7 (\text{mod} 8)$.  
It remains to show our choices of $R_n$ fail (4). Let $T_n$ be the kernel of the surjection $R_n^{\oplus n+1} \to R$ defined by the column of all the $x_i$s. $R$ is projective, so the sequence splits, thus $T_n$ is stably free. 
On the other hand, $R_n$ embeds in $C(S^n)$ and tensoring with $C(S^n)$ turns $T_n$ into the tangent bundle of $S^n$. If $T_n$ is free, said bundle has to be trivial. But $S_n$ has trivial tangent bundle if and only if $n=1,3,7$.
While it is not surprising that topological machinery is helpful, I would still be interested in seeing a pure algebraic example, so if you have one, please post.

REPLY [19 votes]: The more canonical example probably is the standard universal example for such a question. So, let $R_n=k[x_i,y_i]/\sum x_iy_i=1$  where $k$ is any field and there are $2n$ variables. By localization one easily checks that $K_0(R_n)=\mathbb{Z}$ for any $n$. But the projective module given by the presentation,
$$0\to R_n\stackrel{(x_i,\ldots,x_n)}{\to} R_n^n\to P\to 0$$
is clearly stably free but not free if $n\geq 3$. An algebraic proof (given by myself and Madhav Nori) can be found in the article of Swan (Annals of Math studues, vol 113, pp 432-522).

REPLY [3 votes]: Here is an example of a non commutative ring which satisfies (3) but not (4): the integral group ring  $\mathbb{Z}[C_\infty \times Q_8]$ where $Q_8$ is the quaternion group of order 8 and $C_\infty$ is the infinite cyclic group. Using the methods developed by Swan in (Projective resolutions over binary polyhedral groups, Journal fur die Reine und Ang. Math. 342 66---172 (1983)), Frank Johnson at UCL has shown:
(i) $K_0(\mathbb{Z}[C_\infty \times Q_8])\cong K_0(\mathbb{Z}[Q_8])\cong \mathbb{Z}$ (which is (3));
(ii) $\mathbb{Z}[C_\infty \times Q_8]$ has infinitely many isomorphically distinct stably free modules of rank 1. So (4) fails quite badly. 
The proof involves decomposing the ring as a fibre product and then analyzing the module structure a la chapter 2 of Milnor's Algebraic K-Theory.
Swan's paper gives examples of integral group rings of finite groups with stably free, non-free modules. However there are no finite commutative groups whose integral group rings have non-trivial stably frees. T.Y. Lam's excellent book on Serre's problem has lots of information on this kind of thing.