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-10 of 13 results. Next

A367356 Length of base-3 Commas sequence when started at n.

Original entry on oeis.org

17, 5, 2, 1, 16, 164, 490, 163, 4, 3, 489, 15, 14, 2, 162, 161, 13, 1472, 488, 1471, 160, 1, 159, 487, 12, 486, 1470, 1469, 11, 158, 157, 1468, 485, 484, 156, 10, 9, 483, 1467, 1466, 8, 155, 154, 1465, 482, 481, 153, 7, 6, 480, 1464, 1463, 5, 41, 152, 40, 1462, 479, 1461, 151, 4, 150, 478, 39, 477, 3, 1460, 2, 38, 149, 37, 1459, 476, 1458, 148, 1, 147, 475, 36, 474, 1457, 1456, 35, 146, 145, 1455, 473, 472, 144, 34, 33, 471, 1454, 1453, 32, 143, 142, 1452, 470, 469
Offset: 1

Views

Author

N. J. A. Sloane, Nov 18 2023

Keywords

Comments

a(n) = 1 for n = 4, 22, 76, ... (the numbers 222...2211 in ternary)
We now know that a(n) is finite for all n.

Examples

			For a(1) = 17, see A367355, which has 17 terms.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy.ntheory.factor_ import digits
    def a(n, b=3): # generator of terms
        an, y, c = n, 1, 0
        while y < b:
            an, y, c = an + b*(an%b), 1, c+1
            while y < b:
                if str(digits(an+y, b)[1]) == str(y):
                    an += y
                    break
                y += 1
        return c
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Nov 18 2023

A367606 Comma-successor to n working in base 3, but written in base 10, or -1 if n has no successor.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 11 2023

Keywords

Comments

This is a base-3 analog of A367338.
It seems that the indices of the terms equal to -1 are in A168613. - Ivan N. Ianakiev, Dec 12 2023
This is true for A168613(n), n >= 2. See proofs in A367341. - Michael S. Branicky, Dec 15 2023

Crossrefs

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        b = n + 3*(n%3)
        return next((b+y for y in [1, 2] if digits(b+y, 3)[1] == y), -1)
    print([a(n) for n in range(1, 82)]) # Michael S. Branicky, Dec 11 2023

A367609 Comma-number associated with A367607(n), and written in base 3, or -1 if A367607(n) = -1.

Original entry on oeis.org

11, 21, 1, -1, 21, 2, 11, 21, 1, 11, 22, 1, 11, 22, 1, 12, 22, 2, 12, 21, 2, -1, 21, 2, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 22, 1, 11, 22, 1, 12, 22, 2, 12, 22, 2, 12, 22, 2, 12, 22, 2, 12, 22, 2, 12, 22, 2, 12, 22, 2, 12, 21, 2, -1, 21, 2, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11, 21, 1, 11
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2023

Keywords

Comments

This is a base-3 analog of A367339.

Crossrefs

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        b = n + 3*(n%3)
        return next((int("".join(map(str, digits(b+y-n, 3)[1:]))) for y in [1, 2] if digits(b+y, 3)[1] == y), -1)
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Dec 11 2023

A367608 Comma-number associated with A367606(n), but written in base 10, or -1 if A367606(n) = -1.

Original entry on oeis.org

4, 7, 1, -1, 7, 2, 4, 7, 1, 4, 8, 1, 4, 8, 1, 5, 8, 2, 5, 7, 2, -1, 7, 2, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 8, 1, 4, 8, 1, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 7, 2, -1, 7, 2, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2023

Keywords

Comments

If n has a comma-successor m (say) in base 3, then a(n) is the comma-number linking n and m, and is equal to m-n; a(n) = -1 if n has no successor. See A367338 for definitions.
This is a base-3 analog of A367339.

Crossrefs

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        b = n + 3*(n%3)
        return next((b+y-n for y in [1, 2] if digits(b+y, 3)[1] == y), -1)
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Dec 11 2023

A367607 Comma-successor to n working in base 3, and written in base 3, or -1 if n has no successor.

Original entry on oeis.org

12, 100, 11, -1, 110, 22, 102, 120, 101, 112, 201, 111, 122, 211, 121, 210, 221, 202, 220, 1000, 212, -1, 1010, 222, 1002, 1020, 1001, 1012, 1100, 1011, 1022, 1110, 1021, 1102, 1120, 1101, 1112, 1200, 1111, 1122, 1210, 1121, 1202, 1220, 1201, 1212, 2001, 1211, 1222, 2011, 1221, 2010, 2021, 2002, 2020, 2101, 2012, 2100
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2023

Keywords

Comments

This is a base-3 analog of A367338.

Crossrefs

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        b = n + 3*(n%3)
        return next((int("".join(map(str, d3))) for y in [1, 2] if (d3:=digits(b+y, 3)[1:])[0] == y), -1)
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Dec 11 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).

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

Original entry on oeis.org

1, 2, 3, 3, 1, 1, 7, 1, 2, 2, 7, 1, 1, 2, 1, 1, 1, 1, 7, 1, 1, 2, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 7, 7, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 7, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 7
Offset: 1

Views

Author

Keywords

Comments

Analogous to A367617, but the calculations are done in base 3.
See A367338 for definitions of comma-child.
The sequence consists entirely of terms in {1, 2, 3, 7}. In particular, two terms, a(3) = a(4) = 3; five terms, a(2,9,10,14,22) = 2; and 490 terms are 7, ending with a(2182). All other terms a(k) are 1, since a(2183..2190) = 1 and 1 <= p(n) - n <= b^2 - 1 (= 8 for base b = 3).

Crossrefs

Programs

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

Formula

a(n) is defined as n if A367618(n) = -1, else A367618(A367618(n)).

A367598 Record high-points in A367356.

Original entry on oeis.org

17, 164, 490, 1472, 39819, 119228, 3225387, 9657464, 261256395, 782254580, 21161768043
Offset: 1

Views

Author

N. J. A. Sloane, Nov 24 2023

Keywords

Comments

This is the base-3 analog of A367364.

Crossrefs

Extensions

a(7)-a(11) from Michael S. Branicky, Nov 27 2023

A367599 Indices of record high-points in A367356.

Original entry on oeis.org

1, 6, 7, 18, 162, 1458, 13122, 118098, 1062882, 9565938, 86093442
Offset: 1

Views

Author

N. J. A. Sloane, Nov 24 2023

Keywords

Comments

This is a base-3 analog of A367365. The present sequence includes the terms 2*3, 2*3^2, 2*3^6, whereas A367365 includes 4*10 and 4*10^3.
Terms a(4)-a(11) are of the form 2*3^(2*i), i > 0. - Michael S. Branicky, Nov 26 2023

Crossrefs

Extensions

a(7)-a(11) from Michael S. Branicky, Nov 27 2023

A367605 Final term of commas sequence (cf. A121805) if start at 1 and do the calculations in base n; or -1 if the sequence is infinite.

Original entry on oeis.org

-1, 76, 6, 15612, 60466165, 823512, 262122, 32, 99999945, 1771460, 110, 2052, 289254654871, 8649755859206, 18446744073709551480, 83264, 1338258845052394702439737982907, 893871504, 10239999999942, 1801088480, 189, 148035426, 13501, 244140456, 3670344486987375
Offset: 2

Views

Author

N. J. A. Sloane, Dec 08 2023

Keywords

Comments

a(n) is written here in base 10. In base n the values are more revealing: they are -1, 2211_3, 12_4, 444422_5, 5555555541_6, 6666624_7, 777752_8, 35_9, and 99999945_10. That is, they consist of a possibly empty string of digits b-1 followed by a pair of digits xy with x+y = b-1 (see the theorem in A367341).

Crossrefs

The sequences for bases 3, 8, and 10 are A367355, A367344, and A121805.

Extensions

More terms from Michael S. Branicky, Dec 08 2023
Showing 1-10 of 13 results. Next