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.

A367618 a(n) is the unique k such that n is a comma-child of k in base 3, or -1 if k does not exist.

Original entry on oeis.org

-1, -1, -1, 3, 1, 1, -1, 6, 2, 9, 7, 5, 12, 10, 8, 15, 13, 13, 11, 18, 16, 14, 21, 19, 17, 24, 20, 27, 25, 23, 30, 28, 26, 33, 31, 29, 36, 34, 32, 39, 37, 35, 42, 40, 38, 45, 43, 41, 48, 46, 44, 51, 49, 49, 47, 54, 52, 50, 57, 55, 53, 60, 58, 56, 63, 61, 59, 66, 64, 62, 69, 67, 65, 72, 70, 68, 75, 73, 71, 78, 74, 81, 79, 77, 84, 82
Offset: 1

Views

Author

Keywords

Comments

Analogous to A367616, but the calculations are done in base 3.
See A367338 for definitions of comma-child.
May also be called the "comma-parent" of n since n is the comma-child of a(n).

Crossrefs

Programs

  • Python
    from functools import cache
    from sympy.ntheory.factor_ import digits
    def a(n, base=3):
        y = digits(n, base)[1]
        x = (n-y)%base
        k = n - y - base*x
        return k if k > 0 else -1
    print([a(n) for n in range(1, 88)])

Formula

a(n) = n - y - b*((n-y) mod b) where b is the base and y is the first digit of a(n); it is said to exist if a(n) > 0, else undefined (here, -1).