Recent cosmological observations are in good agreement with the scalar spectral index $n_s$ with $n_s-1sim -2/N$, where $N$ is the number of e-foldings. Quadratic chaotic model, Starobinsky model and Higgs inflation or $alpha$-attractors connecting them are typical examples predicting such a relation. We consider the problem in the opposite: given $n_s$ as a function of $N$, what is the inflaton potential $V(phi)$. We find that for $n_s-1=-2/N$, $V(phi)$ is either $tanh^2(gammaphi/2)$ (T-model) or $phi^2$ (chaotic inflation) to the leading order in the slow-roll approximation. $gamma$ is the ratio of $1/V$ at $Nrightarrow infty$ to the slope of $1/V$ at a finite $N$ and is related to $alpha$ in the $alpha$-attractors by $gamma^2=2/3alpha$. The tensor-to-scalar ratio $r$ is $r=8/N(gamma^2 N +1) $. The implications for the reheating temperature are also discussed. We also derive formulas for $n_s-1=-p/N$. We find that if the potential is bounded from above, only $p>1$ is allowed. Although $r$ depends on a parameter, the running of the spectral index is independent of it, which can be used as a consistency check of the assumed relation of $n_s(N)$.