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.

A359247 The bottom entry in the absolute difference triangle of the elements in the Collatz trajectory of n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0
Offset: 1

Views

Author

Michel Lagneau, Dec 22 2022

Keywords

Examples

			a(3) = 1 because the Collatz trajectory of 3 is T = [3, 10, 5, 16, 8, 4, 2, 1], and the absolute difference triangle of the elements of T is:
  3  . 10  .  5  . 16  .  8  .  4  .  2  .  1
     7  .  5  . 11  .  8  .  4  .  2  .  1
        2  .  6  .  3  .  4  .  2  .  1
           4  .  3  .  1  .  2  .  1
              1  .  2  .  1  .  1
                 1  .  1  .  0
                    0  .  1
                       1
with bottom entry a(3) = 1.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&];Flatten[Table[Collatz[n],{n,10}]];Table[d=Collatz[m];While[Length[d]>1,d=Abs[Differences[d]]];d[[1]],{m,100}]
  • PARI
    a(n) = my(list=List([n])); while (n!=1, if(n%2, n=3*n+1, n=n/2); listput(list, n)); my(v = Vec(list)); while (#v != 1, v = vector(#v-1, k, abs(v[k+1]-v[k]))); v[1]; \\ Michel Marcus, Dec 23 2022

Formula

a(2^n) = 1.