On a Liouville-type theorem for linear and nonlinear elliptic differential equations on a torus