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 A246425 #80 May 15 2023 08:43:05 %S A246425 0,1,-2,2,-1,3,-4,4,-2,5,-10,6,-3,7,-9,8,-4,9,-15,10,-5,11,-14,12,-6, %T A246425 13,-24,14,-7,15,-19,16,-8,17,-28,18,-9,19,-24,20,-10,21,-42,22,-11, %U A246425 23,-29,24,-12,25,-41,26,-13,27,-34,28,-14,29,-53,30,-15,31,-39,32,-16,33,-54,34,-17,35,-44,36,-18,37,-71,38,-19,39,-49,40,-20,41,-67,42,-21,43,-54,44,-22,45,-82,46,-23,47,-59,48,-24,49,-80,50 %N A246425 In the Collatz 3x+1 problem: start at an odd number 2n+1 and find the next odd number 2m+1 in the trajectory; then a(n) = m-n. %C A246425 Positive terms indicate the next odd number 2m+1 in the trajectory is greater than 2n+1 which is the case every second time giving a(n) = m-n = (n+1)/2. %C A246425 Negative terms indicate the next odd number 2m+1 in the trajectory is smaller than 2n+1. For behavior of this part refer to A087230. %H A246425 Ruud H.G. van Tol, <a href="/A246425/b246425.txt">Table of n, a(n) for n = 0..20000</a> %H A246425 Ruud H.G. van Tol, <a href="/A246425/a246425_1.txt">Perl program</a> %H A246425 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A246425 a(n) = ((6*n+4)/2^A087230(n) - (2*n+1))/2. %e A246425 a(14)=-9 because 2*14 + 1 = 29 and the Collatz trajectory to reach the next odd number goes: 29, 88, 44, 22, 11. Thus, m=5 and 5 - 14 = -9. %p A246425 f:= proc(n) local m; %p A246425 m:= 6*n+4; %p A246425 m/2^(1+padic:-ordp(m,2))-n-1/2 %p A246425 end proc: %p A246425 map(f, [$0..100]); # _Robert Israel_, Mar 22 2020 %t A246425 a[n_] := ((6n+4)/2^IntegerExponent[6n+4, 2] - (2n+1))/2; %t A246425 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, May 15 2023 *) %o A246425 (PARI) forstep(n=0, 1000, 1, m=6*n+4; print1(((m/2^valuation(m, 2)-(2*n+1))/2),", ")) %Y A246425 Cf. A005408, A075677, A087230, A349414. %K A246425 sign,nice,look %O A246425 0,3 %A A246425 _K. G. Stier_, Aug 26 2014