%I #28 Jun 20 2022 10:12:05
%S 1,5,7,8,10,11,14,24,29,45,53,57,59,60,64,66,67,72,88,96,100,102,103,
%T 109,112,122,127,143,151,155,157,158,165,187,198,232,249,301,327,340,
%U 380,400,410,415,431,439,443,445,446,454,458,460,461,470,498,512,519,541,552,586
%N Partial sums of the trajectory of all positive integers in the 3x+1 or Collatz problem, including the trajectory [1, 4, 2, 1] of 1.
%H Paolo Xausa, <a href="/A347653/b347653.txt">Table of n, a(n) for n = 1..10062</a>
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e The first two rows of A235795 are [1, 4, 2, 1]; [2, 1], so a(1)..a(6) are [1, 5, 7, 8, 10, 11].
%t A235795row[n_]:=If[n==1,{1,4,2,1},NestWhileList[If[OddQ[#],3#+1,#/2]&,n,#>1&]];
%t nrows=10;Accumulate[Flatten[Array[A235795row,nrows]]] (* _Paolo Xausa_, Jun 20 2022 *)
%o (PARI) f(n) = if (n%2, 3*n+1, n/2); \\ A014682
%o row(n) = {my(list=List()); listput(list, n); until(n==1, n = f(n); listput(list, n)); Vec(list);} \\ A235795
%o lista(nn) = {my(s=0, list = List()); for (n=1, nn, my(v = row(n)); for (k=1, #v, s += v[k]; listput(list, s););); Vec(list);} \\ _Michel Marcus_, Sep 10 2021
%Y Partial sums of A235795.
%Y Cf. A006370, A235800, A347270 (all 3x+1 sequences).
%K nonn,look
%O 1,2
%A _Omar E. Pol_, Sep 09 2021