Problem 69. Find the peak 3n+1 sequence value

Created by Cody Team in Cody Challenge

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is even or 3n+1 if the number is odd. See Problem 21 for more information.

Let c(n) be the sequence for n, and p(n) be the peak value of that sequence. For a given threshold nmax, find the highest peak value max(p(n)) for all Collatz sequences starting with integers between 1 and nmax.

Solution Stats

59.28% Correct | 40.72% Incorrect
Last solution submitted on Apr 17, 2018

Problem Comments

Solution Comments

Recent Solvers392


MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more