Centipedes have one pair of legs per body segment. A typical house centipede has 15 pairs of legs. Centipede legs are thin, fragile and subject to loss in encounters with predators or other mishaps.
Centipedes groom their legs several times per day by bringing them in contact with the head. How does a centipede keep track? They groom the legs in sequence from front to back. If a leg is missing the centipede completes the grooming sequence as if the leg were still present….
Source: Living With Insects Blog