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 A359194 #48 Mar 24 2025 05:54:48 %S A359194 1,0,1,6,3,0,13,10,7,4,1,30,27,24,21,18,15,12,9,6,3,0,61,58,55,52,49, %T A359194 46,43,40,37,34,31,28,25,22,19,16,13,10,7,4,1,126,123,120,117,114,111, %U A359194 108,105,102,99,96,93,90,87,84,81,78,75,72,69,66,63,60,57 %N A359194 Binary complement of 3*n. %C A359194 The binary complement takes the binary value of a number and turns any 1s to 0s and vice versa. This is equivalent to subtracting from the next larger Mersenne number. %C A359194 It is currently unknown whether every starting positive integer, upon iteration, reaches 0. %C A359194 From _M. F. Hasler_, Dec 26 2022: (Start) %C A359194 This map enjoys the following properties: %C A359194 (P1) a(2*n) = a(n)*2 + 1 (since 3*(2*n) is 3*n shifted one binary digit to the left, and the one's complement yields that of 3*n with a '1' appended). %C A359194 (P2) As an immediate consequence of (P1), all even-indexed values are odd. %C A359194 (P3) Also from (P1), by immediate induction we have a(2^n) = 2^n-1 for all n >= 0. %C A359194 (P4) Also from (P1), a(4*n) = a(n)*4 + 3. %C A359194 (P5) Similarly, a(4*n+1) = a(n)*4 (because the 1's complement of 3 is 0). %C A359194 (P6) From (P5), a(n) = 0 for all n in A002450 (= (4^k-1)/3). [For the initial value at n = 0 the discrepancy is explained by the fact that the number 0 should be considered to have zero digits, but here the result is computed with 0 considered to have one binary digit.] (End) %H A359194 Michael S. Branicky, <a href="/A359194/b359194.txt">Table of n, a(n) for n = 0..10000</a> %H A359194 Joshua Searle, <a href="https://qedscience.wordpress.com/2021/02/19/collatz-inspired-sequences/">Collatz-inspired sequences</a>. %F A359194 a(n) = A035327(3*n). %F A359194 a(n) = 0 iff n belongs to A002450 \ {0}. - _Rémy Sigrist_, Dec 22 2022 %e A359194 a(7) = 10 because 3*7 = 21 = 10101_2, whose binary complement is 01010_2 = 10. %e A359194 a(42) = 1 because 3*42 = 126 = 1111110_2, whose binary complement is 0000001_2 = 1. %e A359194 a(52) = 99 by %e A359194 3*n = binary 10011100 %e A359194 complement = binary 01100011 = 99. %o A359194 (Python) %o A359194 def a(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length()) - 1) %o A359194 print([a(n) for n in range(67)]) # _Michael S. Branicky_, Dec 20 2022 %o A359194 (PARI) a(n)=if(n, bitneg(3*n, exponent(3*n)+1), 1) \\ _Rémy Sigrist_, Dec 22 2022 %Y A359194 Trisection of A035327. %Y A359194 Cf. A002450, A020988 (indices of 1's). %Y A359194 Cf. A256078. %K A359194 nonn,base,easy %O A359194 0,4 %A A359194 _Joshua Searle_, Dec 19 2022