User blog comment:WaxPlanck/Turing Machines and Prime Numbers/@comment-32994025-20190416182226

I thinik the worst-case time complexity of the algorithm is O(x^3), but I don't know about P function.