cp's OEIS Frontend

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.

A371094 a(n) = m*(2^e) + ((4^e)-1)/3, where m = 3n+1, and e is the 2-adic valuation of m.

This page as a plain text file.
%I A371094 #43 May 01 2024 01:53:52
%S A371094 1,21,7,21,13,341,19,45,25,117,31,69,37,341,43,93,49,213,55,117,61,
%T A371094 5461,67,141,73,309,79,165,85,725,91,189,97,405,103,213,109,1877,115,
%U A371094 237,121,501,127,261,133,1109,139,285,145,597,151,309,157,5461,163,333,169,693,175,357,181,1493,187,381,193,789,199
%N A371094 a(n) = m*(2^e) + ((4^e)-1)/3, where m = 3n+1, and e is the 2-adic valuation of m.
%C A371094 Construction: take the binary expansion of 3n+1 (A016777(n)), and substitute "01" for all trailing 0-bits that follow after its odd part (= A067745(1+n)), of which there are A371093(n) in total. See the examples.
%H A371094 Antti Karttunen, <a href="/A371094/b371094.txt">Table of n, a(n) for n = 0..16384</a>
%H A371094 Michael De Vlieger, <a href="/A371094/a371094.png">Plot binary expansion of a(n) arranged with smallest bit at bottom and largest at top, n increasing from left to right</a> for n = 0..3071. Black indicates 1, white indicates 0.
%H A371094 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%H A371094 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A371094 a(n) = A372289(A016777(n)).
%F A371094 a(2n) = A016777(2n) = A016921(n).
%e A371094 For n=1, 3*n+1 = 4, "100" in binary, when we substitute 01's for the two trailing 0's, we obtain 21, "10101" in binary, therefore a(1) = 21.
%e A371094 For n=6, 3*6+1 = 19, "10011" in binary, and there are no trailing 0's, and no changes, therefore a(6) = 19.
%e A371094 For n=7, 3*7+1 = 22, "10110" in binary, with one trailing 0, which when replaced with 01 gives us 45, "101101" in binary, therefore a(7) = 45.
%e A371094 For n=229, there are e=4 trailing bit expansions 0 -> 01,
%e A371094   3n+1 = binary  101011  0 0 0 0
%e A371094   a(n) = binary  101011 01010101
%t A371094 Array[#2*(2^#3) + ((4^#3) - 1)/3 & @@ {#1, #2, IntegerExponent[#2, 2]} & @@ {#, 3 #1 + 1} &, 67, 0] (* _Michael De Vlieger_, Apr 19 2024 *)
%o A371094 (PARI) A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
%o A371094 (Python)
%o A371094 def A371094(n): return ((m:=3*n+1)<<(e:=(~m & m-1).bit_length()))+((1<<(e<<1))-1)//3 # _Chai Wah Wu_, Apr 28 2024
%Y A371094 Cf. A016777, A067745, A075677, A086893, A096773, A372289, A371093.
%Y A371094 Cf. A016921, A372351 (even and odd bisection), A372290 (numbers occurring in the latter).
%Y A371094 Cf. arrays A372282, A372283 and A371096, A371100, A371102.
%Y A371094 Cf. also A302338.
%K A371094 nonn,easy
%O A371094 0,2
%A A371094 _Antti Karttunen_ (proposed by _Ali Sada_), Apr 19 2024