Originally Posted by
YesNo
I think it would be the same as what you are suggesting to do. The binary representation of the number picks out the powers of 2 in that number.
Python is an OOP language. There are classes and inheritance. You don't need to know much about it to make it work. I started using it when my wife was working on machine learning concepts. We built clusters and then created models. I know (next to) jack about how these things are done, but with the Python packages, such as, pandas, sympy, scikit-learn, and so on, one can get results very quickly with very little actually programming. The programming work has all been done in the packages and it has all been optimized by others. You don't have to program these things, only use what others have packaged to explore your ideas. You are giving me ideas on how to use other packages I have not explored before. It is more a matter of looking up what is available and using that to implement an idea. Also you get mathjax which allows you to format text.
I don't know when I will get a general implementation done. I need to look for the right packages that deal with bit maps or representations of numbers to different bases so as to get factors other than 2. I don't want to have to implement that myself because I will probably implement it wrong and it will not be as efficient.