<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def within_n_mads(n, series):
 """Return true if all values in sequence are within n MADs"""

    mad_score = (series - series.mean()) / series.mad()
    return (mad_score.abs() <= n).all()