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 A355239 #24 Oct 17 2022 11:51:43 %S A355239 5,6,7,9,11,14,15,17,18,19,25,33,39,41,47,51,54,57,59,62,71,81,89,91, %T A355239 107,108,121,159,161,166,183,243,250,252,284,333,376,378,411,432,487, %U A355239 501,639,649,651,667,865,889,959,975,977,1153,1185,1299,1335,1368,1439,1731,1779,1823,2159,2307,2430,2735,3239,3643,4103,4617,4857,4859,6155,7287,7289,9233 %N A355239 Starting values k > 4 of a Collatz iteration reaching either k-1 or k+1. %C A355239 No further terms up to 2*10^9. It is conjectured that this is the full list of starting values of Collatz trajectories reaching k-1 or k+1, and that the number of steps until this happens is one of the 8 terms of A355240. %C A355239 There are no further terms up to 31100000000. - _Dmitry Kamenetsky_, Oct 17 2022 %H A355239 Hugo Pfoertner, <a href="/A355239/a355239.txt">Upward and downward steps in Collatz orbits started at k returning to k+-1, sorted by orbit lengths</a>, (2022). %H A355239 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %o A355239 (Python) %o A355239 def f(x): return 3*x+1 if x%2 else x//2 %o A355239 def ok(n): %o A355239 if n < 5: return False %o A355239 ni, targets = n, {1, n-1, n+1} %o A355239 while ni not in targets: ni = f(ni) %o A355239 return ni in {n-1, n+1} %o A355239 print([k for k in range(10**4) if ok(k)]) # _Michael S. Branicky_, Jul 04 2022 %Y A355239 Cf. A070991, A070993, A355240, A355568, A355569. %K A355239 nonn %O A355239 1,1 %A A355239 _Hugo Pfoertner_, Jul 04 2022