¡La Esquina de la Gramática! Rule 11

When numeral “uno/una” becomes “un”
The numeral uno/una gets shortened to “un” only in the following cases:
1) When it precedes masculine nouns: un libro, un coche.
2) When it precedes feminine nouns that starts with a stressed vowel “a”: un águila, un alma, un hacha.
It should never be shortened when it precedes a feminine noun that doesn’t start with a stressed “a”: una amapola, una mujer, una novela.
The same rule applies with compound numerals that contain the single numeral uno/una: veintiuna mujeres, treinta y una amapolas. It would be wrong to say: veintiún mujeres, treinta y un amapolas (Does it sound familiar?)
Because the numerals uno/una only are shortened when they precede certain type of nouns, it would also be wrong to say: un por ciento, veintiún por ciento. The correct way would be: uno por ciento, veintiuno por ciento (“por” is a preposition, not a noun).
Source: http://www.rae.es