  We propose a general formalism to study the static properties of a system
composed of particles with nearest neighbor interactions that are located on
the sites of a one-dimensional lattice confined by walls (``confined Takahashi
lattice gas''). Linear recursion relations for generalized partition functions
are derived, from which thermodynamic quantities, as well as density
distributions and correlation functions of arbitrary order can be determined in
the presence of an external potential. Explicit results for density profiles
and pair correlations near a wall are presented for various situations. As a
special case of the Takahashi model we consider in particular the hard rod
lattice gas, for which a system of nonlinear coupled difference equations for
the occupation probabilities has been presented previously by Robledo and
Varea. A solution of these equations is given in terms of the solution of a
system of independent linear equations. Moreover, for zero external potential
in the hard rod system we specify various central regions between the confining
walls, where the occupation probabilities are constant and the correlation
functions are translationally invariant in the canonical ensemble. In the grand
canonical ensemble such regions do not exist.
