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 A381055 #18 Aug 13 2025 21:26:29 %S A381055 0,4,-1,10,-2,16,-3,22,-4,28,-5,34,-6,40,-7,46,-8,52,-9,58,-10,64,-11, %T A381055 70,-12,76,-13,82,-14,88,-15,94,-16,100,-17,106,-18,112,-19,118,-20, %U A381055 124,-21,130,-22,136,-23,142,-24,148,-25,154,-26,160,-27,166,-28,172 %N A381055 a(n) = -n/2 if n is even, 3n + 1 if n is odd. %C A381055 If negative indices are allowed, integers m = 0, 1, 2, 3, or 5 (mod 6) appear once (at n = -2*m) in the sequence, while integers m = 4 (mod 6) appear twice (at n = -2*m and (m-1)/3). %C A381055 Conjecture: Iterating the map x -> a(x) on any negative or positive integer eventually reaches 1. Some iteration paths between -35 and 35 are illustrated in the plot of a(n) in LINKS. %H A381055 Ya-Ping Lu, <a href="/A381055/a381055.pdf">A plot of a(n) </a> %H A381055 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1). %F A381055 a(n) = (-1)^(n+1)*A006370(n). %F A381055 a(n) = (1/4)*((-1)^(n+1)*(7*n+2)+5*n+2). %F A381055 G.f.: x*(2*x^2-x+4)/((x-1)^2*(x+1)^2). - _Alois P. Heinz_, Aug 13 2025 %e A381055 a(0) = -0/2 = 0; a(1) = 3*1 + 1 = 4; a(10) = -10/2 = -5. %t A381055 a[n_]:=If[EvenQ[n],-n/2,3n+1];Array[a,58,0] (* _James C. McMahon_, Apr 30 2025 *) %o A381055 (Python) def A381055(n): return 3*n+1 if n%2 else -n>>1 %Y A381055 Cf. A006370, A383131. %K A381055 sign,easy %O A381055 0,2 %A A381055 _Ya-Ping Lu_, Apr 14 2025