Dynamic structure factor of a Bose-Einstein condensate in a one-dimensional optical lattice