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-6 of 6 results.

A367338 Comma-successor to n: second term of commas sequence if initial term is n, or -1 if there is no second term.

Original entry on oeis.org

12, 24, 36, 48, 61, 73, 85, 97, 100, 11, 23, 35, 47, 59, 72, 84, 96, -1, 110, 22, 34, 46, 58, 71, 83, 95, -1, 109, 120, 33, 45, 57, 69, 82, 94, -1, 108, 119, 130, 44, 56, 68, 81, 93, -1, 107, 118, 129, 140, 55, 67, 79, 92, -1, 106, 117, 128, 139, 150, 66, 78, 91, -1, 105, 116
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2023

Keywords

Comments

Construct the commas sequence as in A121805, but take the first term to be n. Then a(n), the comma-successor to n, is the second term, or -1 if no second term exists.
More generally, we define a comma-child of n to be any number m with the property that m-n = 10*x+y, where x is the least significant digit of n and y is the most significant digit of m.
A positive number can have 0, 1, or 2 comma-children. In accordance with the Law of Primogeniture, the first-born child (i.e. the smallest), if there is one, is the comma-successor.
Comment from N. J. A. Sloane, Nov 19 2023: (Start)
The following is a proof of a slight modification of a conjecture made by Ivan N. Ianakiev in A367341.
The Comma-Successor Theorem.
Let D(b) denote the set of numbers k which have no comma-successor in base b ("comma-successor" is the base-b generalization of the rule that defines A121805). If a commas sequence reaches a number in D(b) it will end there.
Then D(b) consists precisely of the numbers which when written in base b have the form
cc...cxy = (b^i-1)*b^2/(b-1) + b*x + y,
with i >= 0 copies of c = b-1, where x and y are in the range [1..b-2] and satisfy x+y = b-1. .... (*)
For b = 10 the numbers D(10) are listed in A367341.
For an outline of the proof, see the attached text-file.
Note that in base b = 2, no values of x satisfying (*) exist, and the theorem asserts that D(2) is empty. In fact it is easy to check directly that every commas sequence in base 2 is infinite. If the initial term is 0 or 1 mod 4 then the sequence will merge with A042948, and if the initial term is 2 or 3 mod 4 then the sequence will merge with A042964.
(End)

Examples

			a(1) = A121803(2) = 12,
a(2) = A139284(2) = 24,
a(3) = 36, since the full commas sequence starting with 3 is [3, 36] (which also implies a(36) = -1),
a(4) = A366492(2) = 48, and so on.
60 is the first number that is a comma-child (a member of A367312) but is missing from the present sequence (it is a comma-child but not a comma-successor, since it loses out to 59).
		

Crossrefs

A367346 lists those n for which there is more than one choice for the second term.
A367612 lists the numbers that are comma-children of some number k.

Programs

  • Maple
    Ldigit:=proc(n) local v; v:=convert(n, base, 10); v[-1]; end;
    A367338 := proc(n) local f,i,d;
    f := (n mod 10);
    d:=10*f;
    for i from 1 to 9 do
    d := d+1;
    if Ldigit(n+d) = i then return(n+d); fi;
    od:
    return(-1);
    end;
    for n from 1 to 50 do lprint(n, A367338(n)); od: # N. J. A. Sloane, Dec 06 2023
  • Mathematica
    a[n_] := a[n] = Module[{l = n, y = 1, d}, While[y < 10, l = l + 10*(Mod[l, 10]); y = 1; While[y < 10, d = IntegerDigits[l + y][[1]]; If[d == y, l = l + y; Break[];]; y++;]; If[y < 10, Return[l]];]; Return[-1];];
    Table[a[n], {n, 1, 65}] (* Robert P. P. McKone, Dec 18 2023 *)
  • Python
    from itertools import islice
    def a(n):
        an, y = n, 1
        while y < 10:
            an, y = an + 10*(an%10), 1
            while y < 10:
                if str(an+y)[0] == str(y):
                    an += y
                    break
                y += 1
            if y < 10:
                return an
        return -1
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Nov 15 2023

A367341 Numbers without comma-successors: these are the numbers k such that if the commas sequence A121805 is started at k instead of 1, there is no second term.

Original entry on oeis.org

18, 27, 36, 45, 54, 63, 72, 81, 918, 927, 936, 945, 954, 963, 972, 981, 9918, 9927, 9936, 9945, 9954, 9963, 9972, 9981, 99918, 99927, 99936, 99945, 99954, 99963, 99972, 99981, 999918, 999927, 999936, 999945, 999954, 999963, 999972, 999981, 9999918, 9999927, 9999936, 9999945, 9999954, 9999963, 9999972, 9999981
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2023

Keywords

Comments

Comment from N. J. A. Sloane, Nov 19 2023 (Start)
Theorem. This sequence consists precisely of the decimal numbers of the form
99...9xy = 100*(10^i-1) + 9*x + 9,
with i >= 0 copies of 9, and 1 <= x <= 8.
(See link for proof.) This was stated without proof by David W. Wilson in 2007 (see the Angelini link), and was conjectured (in a slightly less precise form) by Ivan N. Ianakiev, Nov 16 2023.
This implies that the conjecture below is true, as well as the conjecture in A367342.
All terms are multiples of 9, and A367342 gives a(n)/9.
(End)
Numbers k such that A367338(k) = A367339(k) = -1.
By definition, A330129 is a subsequence.

Crossrefs

Programs

  • Maple
    for i from 0 to 4 do t1:=100*(10^i-1);
     for x from 1 to 8 do lprint(t1+9*x+9);
    od: od:
  • Mathematica
    fQ[n_]:=Module[{k=n+10*Last[IntegerDigits[n]]+Range[9]}, Select[k,#-n==FromDigits[{Last[IntegerDigits[n]],First[IntegerDigits[#]]}]&]] =={};
    Select[Range[10^5],fQ[#]&] (* Ivan N. Ianakiev, Nov 16 2023 *)
  • Python
    from itertools import islice
    def ok(n):
        an, y = n, 1
        while y < 10:
            an, y = an + 10*(an%10), 1
            while y < 10:
                if str(an+y)[0] == str(y):
                    an += y
                    break
                y += 1
            if y < 10:
                return False
        return True
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Nov 15 2023

Formula

The first eight terms are given by a(i) = 9*(i+1), for 1 <= i <= 8; thereafter, each successive block of eight terms is obtained by prefixing the terms of the previous block by 9. - Michael S. Branicky, Nov 15 2023 [This follows from the theorem above. - N. J. A. Sloane, Nov 19 2023]

Extensions

a(33) and beyond from Michael S. Branicky, Nov 15 2023

A367340 List of distinct (positive) numbers appearing in A367338.

Original entry on oeis.org

11, 12, 22, 23, 24, 33, 34, 35, 36, 44, 45, 46, 47, 48, 55, 56, 57, 58, 59, 61, 66, 67, 68, 69, 71, 72, 73, 77, 78, 79, 81, 82, 83, 84, 85, 88, 89, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2023

Keywords

Comments

This is the list of comma-successors.

Crossrefs

Programs

  • Python
    def cp(n):
        y = int(str(n)[0])
        x = (n-y)%10
        k = n - y - 10*x
        kk = k + 10*x + y-1
        return k if k > 0 and int(str(kk)[0]) != y-1 else -1
    def ok(n): return n > 0 and cp(n) > 0
    print([k for k in range(1, 119) if ok(k)]) # Michael S. Branicky, Dec 18 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

A368365 Numbers n whose comma-number is greater than n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 22, 23, 24, 25, 26, 28, 29, 33, 34, 35, 37, 38, 39, 44, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89
Offset: 1

Views

Author

N. J. A. Sloane, Jan 20 2024

Keywords

Comments

Numbers n such that A367338(n) > n.
Since the comma-number is at most 99, this is a finite sequence.

Crossrefs

Showing 1-6 of 6 results.