We use density-matrix renormalization group, applied to a one-dimensional model of continuum Hamiltonians, to accurately solve chains of hydrogen atoms of various separations and numbers of atoms. We train and test a machine-learned approximation to F [n], the universal part of the electronic density functional, to within quantum chemical accuracy. Our calculation (a) bypasses the standard Kohn-Sham approach, avoiding the need to find orbitals, (b) includes the strong correlation of highly-stretched bonds without any specific difficulty (unlike all standard DFT approximations) and (c) is so accurate that it can be used to find the energy in the thermodynamic limit to quantum chemical accuracy.