I come from a C++/Matlab background myself, and have used C# extensively as well. I do prefer those languages but have been working with R more recently.The short list of reasons for why Python is more popular than C#:
1) Not tied to the Microsoft eco-system (although C# is open source), and cross-platform2) Python is easy to learn for people who are new to writing software, also people with a software background can pick it up fast3) Very active communities with tutorials, documentation, etc.4) Many libraries have been built for Python, which makes it more desirable to use5) Much of the Python libraries are written in C++ under the hood so you can get decent speedI'm sure there are other reasons but this is what I've found in my experience this far.Erik
I based my comment about O(log(n)) performance on something previously written by Matt.Here's an interesting graph, comparing the 3 implementations, all in Python. fast0 and fast1 are the ones done by Matt, while matrix is the one you supplied. It's a clear winner. Times are computed using Python timeit capabilities, and represent the average of 10 runs.I think you are correct in that the computation time for doing the additions (and memory copies) of the big int values is causing the quadratic (?) performance of the fast0 algorithm, which has a linear number of operations.
The Institute for Operations Research and the Management Sciences
phone 1 443-757-3500
phone 2 800-4INFORMS (800-446-3676)