Call a number of the form A*B^A, A&B>1 an ABA number. Then a(n) is the smallest ABA number with n representations of this form.

a(n) exists for every n. For example, a(4) <= k = 2^105*3^70*5^126*7^120, where k (a number of 255 digits) has 4 representations with A = 2, 3, 5, and 7. - Giovanni Resta, Jan 09 2014