Simple and accurate calculations on a Lagrange mesh of the hydrogen atom in a magnetic field