a::Int64 = ((a%2==0) ? a : 3*a+1)/2
to a = ((a%2 == 0) ? a : 3a+1) >> 1
or a = div((a%2 == 0) ? a : 3a+1, 2)
for me this gives (329, 837799)
elapsed time: 0.449473338 seconds (544 bytes allocated)
For reference the C version gives ./a.out 1000000 0.40s user 0.00s system 99% cpu 0.407 total
Pumas-AI started two years ago with a mission to modernize and improve the efficiency of predictive health analytics, and we are making rapid progress. Our products have already impacted key decisions in these unprecedented times and there is a growing demand for real-time healthcare analytics, both in Pharmaceutical Drug Development and Precision healthcare at the bedside.
As a result, we are expanding our core team. If you are interested in building products in the healthcare space, please check out our careers page: https://pumas.ai/company/careers