OFFSET
1,2
LINKS
EXAMPLE
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].
MATHEMATICA
A235795row[n_]:=If[n==1, {1, 4, 2, 1}, NestWhileList[If[OddQ[#], 3#+1, #/2]&, n, #>1&]];
nrows=10; Accumulate[Flatten[Array[A235795row, nrows]]] (* Paolo Xausa, Jun 20 2022 *)
PROG
(PARI) f(n) = if (n%2, 3*n+1, n/2); \\ A014682
row(n) = {my(list=List()); listput(list, n); until(n==1, n = f(n); listput(list, n)); Vec(list); } \\ A235795
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
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Omar E. Pol, Sep 09 2021
STATUS
approved