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.

A375265 a(n) = n/3 if n mod 3 = 0; otherwise a(n) = n/2 if n mod 2 = 0; otherwise a(n) = 3*n + 1.

Original entry on oeis.org

4, 1, 1, 2, 16, 2, 22, 4, 3, 5, 34, 4, 40, 7, 5, 8, 52, 6, 58, 10, 7, 11, 70, 8, 76, 13, 9, 14, 88, 10, 94, 16, 11, 17, 106, 12, 112, 19, 13, 20, 124, 14, 130, 22, 15, 23, 142, 16, 148, 25, 17, 26, 160, 18, 166, 28, 19, 29, 178, 20, 184, 31, 21, 32, 196, 22, 202, 34, 23
Offset: 1

Views

Author

Paolo Xausa, Aug 08 2024

Keywords

Comments

Anderson (1987) reformulates the 3x+1 conjecture using this function.

Crossrefs

Cf. A375266 (trajectories).

Programs

  • Maple
    a := n -> ifelse(irem(n, 3) = 0, iquo(n, 3), ifelse(irem(n, 2) = 0, iquo(n, 2), 3*n + 1)): seq(a(n), n = 1..69);  # Peter Luschny, Aug 14 2024
  • Mathematica
    A375265[n_] := Which[Divisible[n, 3], n/3, Divisible[n, 2], n/2, True,3*n + 1];
    Array[A375265, 100]