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.

A049067 LaBar's conjecture (steps to return n to 1 after division by 3 and, if needed, multiplication by 2, addition of 1 or 2).

Original entry on oeis.org

18, 44, 4, 216, 34, 50, 181, 68, 13, 126, 125, 228, 278, 256, 49, 364, 82, 68, 180, 575, 202, 1033, 245, 92, 403, 140, 40, 520, 499, 156, 872, 214, 158, 1400, 221, 264, 399, 368, 317, 1157, 390, 298, 648, 376, 94, 594, 1155, 412, 1983, 500, 133, 808, 226, 122
Offset: 1

Views

Author

Keywords

Comments

Begin with n and repeat the following procedure until 1 is reached: If n is divisible by 3 then apply n -> n/3. Otherwise, alternately apply n -> 2*n+2 and n -> 2*n+1. Then a(n) is the sum of the numbers produced by this process, including n and 1. - David Radcliffe, Aug 28 2025

Examples

			Beginning at n=1, algorithm produces s+t+a=18.
a(2) = 44 because the trajectory of n=2 is (2, 6, 2, 5, 12, 4, 9, 3, 1) and these numbers sum to 44. - _David Radcliffe_, Aug 28 2025
		

Crossrefs

Cf. A049074.

Programs

  • Python
    def A049067(n):
        s = n
        c = 2
        while n > 1 or s == n:
            if n % 3 == 0:
                n //= 3
            else:
                n = 2*n + c
                c = 3 - c
            s += n
        return s # David Radcliffe, Aug 28 2025