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 A359209 #44 Jun 20 2025 20:22:49 %S A359209 0,1,2,5,10,21,39,40,42,71,72,78,85,142,150,157,163,167,168,170,285, %T A359209 291,300,303,311,313,315,316,317,319,320,321,322,327,328,329,331,333, %U A359209 334,335,336,338,339,340,341,569,571,572,573,575,576,577,578,579 %N A359209 Numbers that under iteration of the map x->A359194(x) (binary complement of 3n) until 0 is reached never exceed the initial term. %C A359209 If it can be shown that all iterations of A359194 eventually reach one of the terms of this sequence, it would prove that all such trajectories are finite. %C A359209 From _M. F. Hasler_, Dec 26 2022: (Start) %C A359209 (1) If A359194(x) = a(k) for some a(k) < x, then x is also in the sequence. %C A359209 (2) The orbit of any x under iterations of A359194 is finite if and only if it reaches a term of this sequence. %C A359209 (3) No term has binary digits starting with '11...', i.e., all terms > 1 have binary digits starting '10...'. %C A359209 (4) If the 3rd binary digit of a(n) is a '1', it cannot be followed by another bit 1, so all terms > 5 have a binary representation of the form '100...' or '1010...' %C A359209 (5) A substring of '11', i.e., two consecutive bits 1, in a term of this sequence, is necessarily preceded by an earlier substring '00', i.e., two consecutive bits 0 to the left of the '11'. [This implies (3) and (4).] (End) %e A359209 40 is a term since its trajectory is 40 -> 7 -> 10 -> 1 -> 0, which never exceeds 40. %p A359209 bc:= n -> 2^(1+ilog2(n))-1-n: bc(0):= 1: %p A359209 filter:= proc(n) local x; %p A359209 x:= n; %p A359209 while x <> 0 do %p A359209 x:= bc3(x); %p A359209 if x > n then return false fi; %p A359209 od; %p A359209 true %p A359209 end proc: %p A359209 select(filter, [$0..1000]); # _Robert Israel_, Dec 22 2022 %t A359209 f[n_] := BitXor[3 n, 2^IntegerPart[Log2[3 n] + 1] - 1]; Select[Range[0, 200], Function[n, AllTrue[NestWhileList[f, n, # != 0 &], # <= n &]]] (* _Michael De Vlieger_, Dec 21 2022 *) %o A359209 (Python) %o A359209 def f(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length())-1) %o A359209 def ok(n): %o A359209 i, fi, m = 0, n, n %o A359209 while fi != 0 and m <= n: i, fi, m = i+1, f(fi), max(m, fi) %o A359209 return m <= n %o A359209 print([k for k in range(580) if ok(k)]) # _Michael S. Branicky_, Dec 20 2022 %o A359209 (PARI) f(n) = if(n, bitneg(n, exponent(n)+1), 1); \\ A035327 %o A359209 isok(m) = my(km=m); while (m, m=f(3*m); if (m>km, return(0))); return(1); \\ _Michel Marcus_, Dec 21 2022 %Y A359209 Cf. A035327, A359194, A359207, A359208, A359255. %K A359209 nonn,base %O A359209 1,3 %A A359209 _Joshua Searle_, Dec 20 2022