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 A386437 #29 Aug 06 2025 14:50:03 %S A386437 1,1,-13,3,-6,19,-24,5,19,16,-9,-7,-23,38,-212,11,14,-1,-85,4,-22,31, %T A386437 -181,31,72,49,-21488,-10,-46,242,21412,21,-89,20,-134,37,-9,123,-104, %U A386437 36,-21433,64,-104,13,-43,227,21475,17,-16,-22,-246,3,-63,21542,21040,66,75,104 %N A386437 Alternating sum of the numbers in the trajectory of n for the 3x+1 problem. %C A386437 Conjecture: Let P(n) be the set of distinct positive prime numbers that appear in the first n terms of the sequence. Let Q(n) be the subset of those primes that appear with frequency >= 2. Then, as n -> oo, the ratio |Q(n)|/|P(n)| tends to 11/100. Verified for n <= 5 * 10^7. %C A386437 a(n) < A033493(n), for all n > 1. %C A386437 Conjecture: Let S(n) be the set of positive prime numbers that appear in the first n terms of the sequence. Then, as n -> oo, the ratio |S(n)|/n tends to 0. Verified for n <= 10^6. %H A386437 Alois P. Heinz, <a href="/A386437/b386437.txt">Table of n, a(n) for n = 1..10000</a> %H A386437 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A386437 a(n) = Sum_{k=1..A006577(n)} A070165(n,k) * (-1)^(k+1). %e A386437 a(3) = 3 - 10 + 5 - 16 + 8 - 4 + 2 - 1 = -13. %p A386437 a:= proc(n) option remember; n-`if`(n=1, 0, %p A386437 a(`if`(n::even, n/2, 3*n+1))) %p A386437 end: %p A386437 seq(a(n), n=1..58); # _Alois P. Heinz_, Jul 24 2025 %t A386437 a[n_] := Module[{x = n, seq = {n}},While[x != 1, x = If[EvenQ[x], x/2, 3 x + 1]; AppendTo[seq, x]];Total[seq*Table[(-1)^i, {i, 0, Length[seq] - 1}]]]Table[a[n], {n, 1, 60}] %o A386437 (PARI) a(n) = my(s=n, m=n, k=-1); while (m != 1, if (m%2, m=3*m+1, m=m/2); s+=k*m; k=-k); s; \\ _Michel Marcus_, Jul 25 2025 %Y A386437 Cf. A033493, A006577, A070165. %K A386437 sign,look %O A386437 1,3 %A A386437 _Luca Santarsiero_, Jul 21 2025