function pmax = peakOfPeaks(nmax)
How would I speed this up?
If I input nmax = 2^60, my program cannot finish.
This solution will fail for nmax = 2; so I had to swap the order of two lines. See Solution 1088355.
i'm totally lost with this!
wrong, corrected in soln 329062
I only feel justified in doing this because the previous best answer was a look-up table. :P
Clever pattern, but still gaming the system. This is not the absolute highest Collatz peak as you go to infinity. Yuval, you should be ashamed of submitting this without apologies.
This really doesn't solve the problem it's just gaming the results.
Ooooooh this is evil.
Compute a dot product of two vectors x and y
Piecewise linear interpolation
The Answer to Life, the Universe, and Everything
Find the dimensions of a matrix
MATLAB Basic: rounding
Find the alphabetic word product
Maximum running product for a string of numbers
Find state names that start with the letter N
Find common elements in matrix rows
Finding Perfect Squares
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office