If I had to guess I would presume the OP has not done a formal analysis of the algorithm. This would undoubtedly be the contribution of the professor/researcher assuming the analysis proves it is an improvement over prior algorithms. This analysis/proof is certainly worth being a second author even if it is not a contribution to the algorithm itself.
Perhaps we're estimating differently the amount of work which will be needed to turn this into an actual paper.
But I've never published in a maths journal (only physics) so you probably know better than I do on this point.
Only if you've feeling very generous. I would acknowledge help received in a section at the end of the paper, but I would never list a co-author who didn't contribute any of the ideas.