Representing Ratio's in Algebraic Formulae

Okay so i'm looking to create algebraic formula's specific ratio's. This relates to interval relationships in a musical scale for example:

An octave has ratio of 2:1 which is represented by the following formula:

where n = the number of octaves.

So if i wanted to find the value of the frequency 10 octaves above 20 hertz i would say:

So i'm wondering how you would formulate this for other frequency ratios. i.e:

3:2, 5:4 etc.

Any help would be great.

Cheers

BIOS