The energy spectrum of electrons on a square lattice in an applied magnetic field composes the famous Hofstadter butterfly with a recursive internal subband structure. An effective method for calculating the Green function for such a system is proposed. The standard approach requires an explicit knowledge of the eigenstates and eigenenergies of the system; here we derive a Harper-like equation, that allows us to calculate the Green function for the lattice electrons in the field directly. The method is particularly useful in the weak-field regime, where the standard calculations are cumbersome.Introduction The problem of two-dimensional Bloch electrons in an applied magnetic field has been intensively studied for several decades. Besides exhibiting an extremely rich energy band structure, it can be related to various phenomena such as the quantum Hall effect or superconductivity in the presence of magnetic field [1]. The energy spectrum of a system of tightly bound electrons on a square lattice in a perpendicular uniform magnetic field exhibits interesting, multifractal properties. It is described by a model commonly referred as the Hofstadter or Azbel-Hofstadter model [2,3]. The band spectrum for rational values of the magnetic flux through an elementary plaquete F is known as the ''Hofstadter butterfly" [2]. In spite of the academic character of the model, experiments have been performed to uncover the multifractal structure [4]. This paper provides explicit expressions for the lattice Green functions in the presence of a magnetic field, that are convenient for both analytical and numerical calculations.Following Hofstadter, we start from the Schraedinger equation, where the tight-binding Hamiltonian is given by