The totient command computes the number of integers less than n that are relatively prime to n. These numbers are all invertible modulo n.
totient(15); 8 totient(24); 8