Solution (source code)

= Solution

Use the standard complex <K-theory Thom class> convention. For a rank-$r$ complex <vector bundle>, its <K-theory Euler class> is the pullback of the <K-theory Thom class> along the zero section, namely
$$
\boxed{e_K(E)=\lambda_{-1}(E^*)=\sum_{j=0}^r(-1)^j[\Lambda^jE^*]\in K^0(X).}
$$
Here $\Lambda^j$ denotes an <exterior power>, and a <Hermitian metric> identifies the <dual bundle> with the conjugate <vector bundle>. Choosing $\lambda_{-1}(E)$ instead changes the <K-theory Euler class> by the unit $(-1)^r[\det E]$, so its kernel and cokernel computations are unchanged.

For the <disk bundle> $D(E)$ and <sphere bundle> $S(E)$, the <K-theory Thom class> identifies $K^i(D(E),S(E))$ with $K^i(X)$. The <exact sequence> of this pair becomes the <K-theory Gysin sequence of a sphere bundle>:
$$
\boxed{\cdots\longrightarrow K^i(X)\xrightarrow{\ e_K(E)\cdot\ }K^i(X)
\xrightarrow{\pi^*}K^i(S(E))\xrightarrow{\partial}K^{i+1}(X)
\xrightarrow{\ e_K(E)\cdot\ }K^{i+1}(X)\longrightarrow\cdots.}
$$
The groups are two-periodic by <Bott periodicity>.

View <Real projective space> as the <circle bundle> of $\gamma^{\otimes2}$ over <Complex projective space>, where $\gamma\to\mathbb{CP}^n$ is the <tautological bundle>. Indeed, $S^{2n+1}/\{\pm1\}=\mathbb{RP}^{2n+1}$ maps to $S(\gamma^{\otimes2})$ by $[v]\mapsto v\otimes v$; in each fiber squaring identifies exactly $v$ and $-v$.

Use <Complex K-theory of complex projective space> in the form
$$
R=K^0(\mathbb{CP}^n)=\mathbb Z[t]/(t^{n+1}),\qquad
 t=1-[\gamma],\qquad K^{-1}(\mathbb{CP}^n)=0.
$$
The <K-theory Euler class> of $\gamma^{\otimes2}$ is $1-[\gamma]^{-2}$. Multiplying it by the unit $-[\gamma]^2$ gives $1-[\gamma]^2=2t-t^2$. The <K-theory Gysin sequence of a sphere bundle> therefore gives
$$
K^0(\mathbb{RP}^{2n+1})\cong R/(2t-t^2),\qquad
K^{-1}(\mathbb{RP}^{2n+1})\cong\ker((2t-t^2)\cdot:R\to R).
$$
Under the projection $q:\mathbb{RP}^{2n+1}\to\mathbb{CP}^n$, the <pullback vector bundle> $q^*\gamma$ is the <complexification of a real vector bundle> $L$ of the <tautological bundle> of <Real projective space>: the fiber map sends $[v,z]$ to $zv$. Thus $t$ pulls back to $1-[L]$. Put $\mu=[L]-1$. The relation $L^{\otimes2}\cong1$ gives $\mu^2=-2\mu$, and $t^{n+1}=0$ gives $2^n\mu=0$. Hence
$$
\boxed{K^0(\mathbb{RP}^{2n+1})\cong
\mathbb Z[\mu]/(\mu^2+2\mu,\,2^n\mu),\qquad \mu=[L]-1.}
$$
For completeness, these relations give precisely the <abelian group> $\mathbb Z\oplus\mathbb Z/2^n$. In the basis $t,\ldots,t^n$, the image of multiplication by $2t-t^2$ is generated by $2t-t^2,2t^2-t^3,\ldots,2t^n$; its relation matrix is triangular with determinant $2^n$, and the relations express every $t^j$ as $2^{j-1}t$. Thus there is exactly one cyclic <torsion subgroup> of order $2^n$.

If $n\geq1$ and $a=a_0+a_1t+\cdots+a_nt^n$ is in the kernel, successive coefficients of $(2t-t^2)a$ give $2a_0=0$, $2a_1-a_0=0$, and so on, up to $2a_{n-1}-a_{n-2}=0$. Hence $a_0=\cdots=a_{n-1}=0$, with $a_n$ arbitrary. For $n=0$ the multiplier is zero on $R=\mathbb Z$. In all cases,
$$
\boxed{K^{-1}(\mathbb{RP}^{2n+1})\cong\mathbb Z\qquad(n\geq0).}
$$

Finally let $E=L^{\oplus k}$ with $k\geq1$, over $B=\mathbb{RP}^{2n+1}$. Since $L^*\cong L$, multiplicativity of the <K-theory Euler class> gives
$$
e_K(E)=(1-[L])^k=(-\mu)^k=-2^{k-1}\mu.
$$
On $K^0(B)=\mathbb Z\oplus(\mathbb Z/2^n)\mu$, the image of multiplication by this <K-theory Euler class> is the subgroup generated by $2^{k-1}\mu$: multiplication by an integer produces every such multiple, while multiplication by $\mu$ only adds multiples of $2^k\mu$. Therefore
$$
\operatorname{coker}(e_K(E):K^0(B)\to K^0(B))
\cong\mathbb Z\oplus\mathbb Z/2^{\min(n,k-1)}.
$$
Multiplication by $\mu$ is zero on $K^{-1}(B)\cong\mathbb Z$, since $2^n\mu=0$ and this <abelian group> has no nonzero <torsion elements>. Thus the <K-theory Gysin sequence of a sphere bundle> gives a <short exact sequence>
$$
0\longrightarrow\mathbb Z\oplus\mathbb Z/2^{\min(n,k-1)}
\longrightarrow K^0(S(E))\longrightarrow\mathbb Z\longrightarrow0.
$$
It splits as an <exact sequence> of <abelian groups> because its quotient is a <free abelian group>. Consequently
$$
\boxed{K^0(S(L^{\oplus k}))\cong\mathbb Z^2\oplus\mathbb Z/2^{\min(n,k-1)}\qquad(n\geq0,\ k\geq1).}
$$
The convention $\mathbb Z/1=0$ covers $n=0$ and $k=1$. For example, when $k=1$ the <sphere bundle> is $(S^{2n+1}\times S^1)/\{(v,z)\sim(-v,-z)\}$, a <mapping torus> of the antipodal map; its <Topological K-theory> has no nonzero <torsion elements>, agreeing with the formula. If $k=0$ is allowed, the rank-zero <vector bundle> has an empty unit <sphere bundle>, so $K^0(S(E))=0$ instead.