cp's OEIS Frontend

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.

A347653 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.

Original entry on oeis.org

1, 5, 7, 8, 10, 11, 14, 24, 29, 45, 53, 57, 59, 60, 64, 66, 67, 72, 88, 96, 100, 102, 103, 109, 112, 122, 127, 143, 151, 155, 157, 158, 165, 187, 198, 232, 249, 301, 327, 340, 380, 400, 410, 415, 431, 439, 443, 445, 446, 454, 458, 460, 461, 470, 498, 512, 519, 541, 552, 586
Offset: 1

Views

Author

Omar E. Pol, Sep 09 2021

Keywords

Examples

			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].
		

Crossrefs

Partial sums of A235795.
Cf. A006370, A235800, A347270 (all 3x+1 sequences).

Programs

  • 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 *)
  • 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