This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A368136 #115 Feb 14 2024 10:46:55 %S A368136 3,4,6,9,10,15,16,17,20,23,24,27,29,31,48,54,57,78,85,94,111,118,123, %T A368136 127,129,134,136,171,172,225,368,419,540,547,706,744,1112,1148,1169, %U A368136 1229,1308,1403,1545,1782,1869,1926,1939 %N A368136 Numbers k for which a generalized Collatz trajectory (x / k if k divides x, x + ceiling(x / k) otherwise) has non-elementary loops starting from a positive integer x_0 < k^2. %C A368136 For a given k, define the generalized Collatz trajectory starting at x_0 > 0 as follows: %C A368136 x_(i+1) = x_(i) / k if k divides x_(i); %C A368136 x_(i+1) = x_(i) + ceiling(x_(i) / k) otherwise. %C A368136 For k = 2, this is equivalent to the Collatz step x -> x/2 or (3x + 1)/2. %C A368136 We call a loop an 'elementary loop' if it contains 1 as a term and otherwise a 'non-elementary loop'. The loop containing 1 consists of the terms 1, 4, 2, 1 for k = 2, or 1, 2, ..., k, 1 for other k. %C A368136 k^2 has been chosen as an arbitrary boundary, giving more terms of the (limiting) sequence (i.e., the unknown sequence that would result if no boundary were used) than using 2*k, 3*k, or similar boundaries. It is unknown whether there are values of k for which non-elementary loops exist only for values greater than k^2. %C A368136 It is also unknown whether there are values of k and x_0 for which trajectories do not contain any loop. Such values would be terms of the sequence only if there are also non-elementary loops. %H A368136 Walter Carnielli, <a href="https://www.emis.de/journals/AMEN/2015/AMEN(150711).pdf">Some natural generalizations of the Collatz Problem</a>, Applied Mathematics E-Notes 15 (2015): 207-215. %H A368136 Wikipedia, <a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Collatz Conjecture</a>. %H A368136 Wikipedia, <a href="https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare">Floyd's cycle detection algorithm</a>. %H A368136 OEIS Wiki, <a href="https://oeis.org/wiki/3x%2B1_problem">3x+1 problem</a>. %e A368136 k = 3 is a term since it has a non-elementary loop starting from x_0 = 7: %e A368136 7, 10, 14, 19, 26, 35, 47, 63, 21, 7, ... %e A368136 k = 2 is not a term since it has no non-elementary loops starting from x_0 < 4. %o A368136 (Python) %o A368136 def containsloops(k): %o A368136 for x_ in range(k, k*k): %o A368136 s = 0 %o A368136 x = x_ %o A368136 m = x %o A368136 while x != 1 and s <= m: %o A368136 d, r = divmod(x, k) %o A368136 x = d if r == 0 else d + x + 1 %o A368136 s += 1 %o A368136 m = max(m, x) %o A368136 if s > m and x > k: %o A368136 return True %o A368136 return False %o A368136 print([k for k in range(1, 100) if containsloops(k)]) %Y A368136 Cf. A006370. %Y A368136 See A033478 for an example of a trajectory (based on the 3x + 1 formulation) with k = 2 and x_0 = 3, ending in an elementary loop. %K A368136 nonn,more %O A368136 1,1 %A A368136 _Giuseppe Ciacco_, Dec 13 2023 %E A368136 a(43)-a(45) from _Giuseppe Ciacco_, Feb 05 2024 %E A368136 a(46)-a(48) from _Giuseppe Ciacco_, Feb 14 2024