Compound interest arises when interest is added to the principal so that from that moment on, the interest that has also been added itself earns interest. This addition of interest to the principal is called compounding.
The compounding usually happens with some frequency (yearly, half-yearly, quarterly, monthly, daily, etc.) Usually, banks define nominal interest rate (f.e. 12%) and compounding frequency (f.e. monthly).
S - balance
P - principal
j - nominal interest rate (fraction of 1)
m - compounding frequency (number of compounding periods per year)
n - term (years)