It is well known that the continued fraction expansion of ${\sqrt{d}}$ has the form $[{\alpha}_0,\;{\bar{{\alpha}_1,\;{\ldots},\;{\alpha}_{l-1},\;2_{{\alpha}_0}}]$ and ${\alpha}_1,\;{\ldots},\;{\alpha}_{l-1}$ is a palindromic sequence of positive integers. For a given positive integer l and a palindromic sequence of positive integers ${\alpha}_1,\;{\ldots},\;{\alpha}_{l-1},$ we define the set $S(l;{\alpha}_1,\;{\ldots},\;{\alpha}_{l-1})\;:=\;\{d{\in}{\mathbb{Z}}{\mid}d>0,\;{\sqrt{d}}=[{\alpha}_0,\;{\bar{{\alpha}_1,\;{\ldots},\;{\alpha}_{l-1},\;2_{{\alpha}_0}}],\;where\;{\alpha}_0={\lfloor}{\sqrt{d}}{\rfloor}\}.$ In this paper, we completely determine when $S(l;{\alpha}_1,\;{\ldots},\;{\alpha}_{l-1})$ is not empty in the case that l is 4, 5, 6, or 7. We also give similar results for $(1+{\sqrt{d}})/2.$ For the case that l is 4, 5, or 6, we explicitly describe the fundamental units of the real quadratic field ${\mathbb{Q}}({\sqrt{d}}).$ Finally, we apply our results to the Mordell conjecture for the fundamental units of ${\mathbb{Q}}({\sqrt{d}}).$