I'm making a level calculation system, based on geometric progression, with initial term $a_1=100$ and ratio $r=2$.
So, we have an equation for min. $x$ and max. $a$ XP values per level $n$:
$a_n = a_1*r^{n-1} \\ x_n = a_{n-1} = a_1*r^{n-2}$
I need to get a level (aka. $a$ term) basing on current player's XP (aka. $p$ point), like in next four examples:
$p = 64 = a_1 \\ p = 128 = a_2 \\ p = 256 = a_3 \\ p = 512 = a_4$
What formula will suit me in this case?