Step 1: Choose an arbitrary positive integer A as the first item in the sequence. Step 2: If A = 1 then stop. Step 3: If A is even, then replace A by A / 2 and go to step 2. Step 4: If A is odd, t
4981: Collatz Conjecture 题目描述 In 1978 AD the great Sir Isaac Newton, whilst proving that P is a strict superset of N P, defined the Beta Alpha Pi Zeta function f as follows over any sequence o
4981: Collatz Conjecture 时间限制: 6 Sec 内存限制: 128 MB 提交: 210 解决: 21 [ 提交][ 状态][ 讨论版][命题人: admin] 题目描述 In 1978 AD the great Sir Isaac Newton, whilst proving that P is a strict superset of
Collatz序列,也称为3n+1问题,遵循以下3个规则获得序列中的下一个数: 1、如果n是偶数,则下一个数 n = n / 22、如果n是奇数,则下一个数 n = n * 3 +13、如果n为1,则停止计算;否则重复计算获取下一个数 从任意一个整数开始,按照以上规则计算,序列的最后一个元素都是1。 # //# Collatz序列# 说明:Collatz序列,也称为3n+1问题,遵循以