The questions origins from this problem and my incorrect answer to it. I'm trying to correct it, but it turned out that the topological space - that I need to do it straightforward - has very specific properties. I'm really curious, if such a thing exists.
We are looking for a sequence $Y_n$ of (at most) $n$-dimensional CW-complexes such that their fundamental group is $\mathbb Z$ and homology groups vanish for $1<i<n$. Of course the circle is a valid example but there is an additional assumption: after gluing a $2$-disk along the generator of $\pi_1$ (it should be the same generator for all $n$), we get a "boundaryless" CW-complex. It means that if a point lies in a boundary of some $k$-cell, there must be at least two such $k$-cells.
Here we still can use $Y_n=S^1\times [0,1)$, but there is one more assumption: the space should admit a complete and finite geodesic metric. The pair: completeness + boundedness is the thing that stopped me.
Summing up:
- $Y_n\subseteq Y_{n+1}$ are CW-complexes and dimension of $Y_n$ is no bigger than $n$,
- $\pi_1(Y_n) = \mathbb Z = \langle[g]\rangle$ for all $n$, where $g$ is a fixed homeo $S^1\to Y_1$,
- $H_k(Y_n) = 0$ for all $1<k<n$,
- $Y_n$ with $D^2$ glued along $g$ is a "boundaryless" CW-complex,
- $Y_n$ admits a complete and finite geodesic metric.
P.S. The sequence doesn't have to start with $1$.
P.P.S. Being "boundaryless" is a property of a CW-structure not a topological space. We require existence of such structure for each $Y_n$.
P.P.P.S. A regular CW-complex is needed in the original problem, but I would be more than happy to see any CW-complex with the above properties.