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.

Showing 1-2 of 2 results.

A367617 a(n) is the most remote positive ancestor of n in the comma-child graph.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 10, 2, 25, 26, 27, 28, 29, 30, 31, 32, 30, 21, 1, 3, 37, 38, 39, 40, 41, 42, 43, 40, 31, 20, 13, 4, 49, 50, 51, 52, 53, 54, 50, 41, 32, 10, 14, 14, 5, 62, 63, 64, 65, 14, 51, 42, 30, 30, 2, 15, 6, 74, 75
Offset: 1

Views

Author

Keywords

Comments

Like A367366 but allows ancestors that are not comma-predecessors. More specifically, A367366(n) is the most remote positive ancestor of n in the comma-successor graph. See A367338 for definitions.
This sequence first differs from A367366 at n = 60.

Examples

			a(60) = a(66) = 14, since 66 is a comma-child of 60, and 60 is a comma-child of 14, and 14 is not the comma-child of any positive number. In other words, A367616(A367616(66)) = A367616(60) = 14, and A367616(14) = -1.
		

Crossrefs

Programs

  • Python
    def comma_parent(n): # A367616(n)
        y = int(str(n)[0])
        x = (n-y)%10
        k = n - y - 10*x
        return k if k > 0 else -1
    def a(n):
        an = n
        while (cp:=comma_parent(an)) > 0: an = cp
        return an
    print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Dec 18 2023

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).
Showing 1-2 of 2 results.