Click A and B to change their values. You can find the block under sprite1. Feel free to use it.
I came up with this myself, it is entirely possible that someone has already come up with it. Negative bases will not work because the formula uses a logarithm.