If you have a block with mass on a spring with spring constant , the period and frequency of its oscillation are
If you are given and , it's easy to calculate these. If you are given the period or frequency, however, you can solve for or by first squaring both sides, getting and then solving for the desired variable.
For a pendulum, the formulae are very similar, although we use the constant .