A first part (1) comprises means (11) for connection to the body and receives in a sliding manner a second part (2) that comprises means (21) for connection to the body. A permanent magnet (3) is mounted in rotation relative to the first part (1). Step-down gears (51, 52) transform its movements into a rotation, alternately in one direction and in the other, of an input shaft (41) with a gear reduction ratio. A free wheel (43) drives an output shaft (42) when the input shaft (41) turns in one direction. The output shaft (42) is blocked in the other direction by retaining means (44). Transmission means (61, 62) transform the rotation of the output shaft (42) into a displacement of the second part (2) relative to the first part (1). The invention permits the production of bone prostheses allowing growth, of intramedullary nails allowing elongation or movement of bone, of spinal distraction or compression rods, or of bone distractors or intercostal distractors, and also of implantable remote-controlled pumps.