Leg cramping at night is thought to be associated with magnesium deficiency, and magnesium ... Magnesium has a hand in adenosine triphosphate synthesis, says Wagner, which is produced in the ...