OFFSET
1,1
COMMENTS
Repeats every forty-four terms starting at 187. Although other loops exist for the "3x+5" map, including 5 -> 20 -> 10 -> 5 and 19 -> 62 -> 31 -> 98 -> 49 -> 152 -> 76 -> 38 -> 19, this loop is much longer and does not appear in the trajectories of as many numbers.
If the Collatz conjecture is false, it will most likely fail because of the existence of a long loop.
a(n) never ends with 0 or 5. a(n+4) - a(n) ends with 0 or 5. - Paul Curtz, Dec 29 2021
LINKS
J. C. Lagarias, The set of rational cycles for the 3x+1 problem, Acta Arithmetica, LVI (1990), pp. 33-53.
FORMULA
a(n) = A181762(a(n-1)) for n > 1, with a(1) = 187.
MATHEMATICA
a[1] = 187; a[n_] := a[n] = If[OddQ[a[n - 1]], 3*a[n - 1] + 5, a[n - 1]/2]; Array[a, 50] (* Amiram Eldar, Dec 25 2021 *)
PROG
(C++)#include <iostream>
int main() {
unsigned long number = 187;
int tries = 0;
while(number > 1 && tries++ < 50) {
std::cout << number << ", ";
if (number % 2 == 0)
number /= 2;
else
number = number * 3 + 5;
}
}
(Python)
N, alst, f = 48, [187], lambda x: x//2 if x%2 == 0 else 3*x + 5
[alst.append(f(alst[-1])) for _ in range(N)]
print(alst) # Michael S. Branicky, Dec 28 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eduardo J. Acuña Tarazona, Dec 22 2021
STATUS
approved