If you want to add more tests: https://oeis.org/A006884 and https://oeis.org/A006885 contain the relevant sequences.
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.
Project Euler: Problem 5, Smallest multiple
Compute a dot product of two vectors x and y
Get the elements of diagonal and antidiagonal for any m-by-n matrix
Will there be a new leader?
Can we make a triangle?
Most nonzero elements in row
Remove all the consonants
The Goldbach Conjecture
Counting in Finnish
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