2m+3=23
2m=20
m=10
let me know in the comments if you need further explanation :)
The amount of balls in a given layer can be found by squaring the layer it is in
4 layers
top layer (1st) is 1
2nd is 4
3rd layer is 9
4th is 16
add them up
1+4+9+16=30
30 in that pyramid