Computing gapped lengths