26 de dez. de 2025

Problem 14

Longest Collatz sequence

Problem 14

n>n/2 n -> n/2n>3n+1 n -> 3n+1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.

Which starting number, under one million, produces the longest chain?

NOTE: Once the chain starts the terms are allowed to go above one million.

Tentativa 1 - 26/12/2025

Uai, parece que um bruteforce vai ser o suficiente

JavaScript REPL

Resposta demorou um pouco mas saiu 837799

Recent Articles

Advent of Code 2025 - 01
Desafios
Added on: 28 de dez. de 2025
Sobre Project Euler
Desafios
Added on: 28 de dez. de 2025
Problem 20
Desafios
Added on: 28 de dez. de 2025
Problem 21
Desafios
Added on: 28 de dez. de 2025
Problem 22
Desafios
Added on: 28 de dez. de 2025

© 2026