Update bNumbers.py

Update recursive function
Make modular
Add tests