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 22 results. Next

A367339 a(n) = A367338(n) - n, or -1 if A367338(n) = -1.

Original entry on oeis.org

11, 22, 33, 44, 56, 67, 78, 89, 91, 1, 12, 23, 34, 45, 57, 68, 79, -1, 91, 2, 13, 24, 35, 47, 58, 69, -1, 81, 91, 3, 14, 25, 36, 48, 59, -1, 71, 81, 91, 4, 15, 26, 38, 49, -1, 61, 71, 81, 91, 5, 16, 27, 39, -1, 51, 61, 71, 81, 91, 6, 17, 29, -1, 41, 51, 61, 71, 81, 91, 7, 18, -1
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2023

Keywords

Comments

Construct the commas sequence as in A121805, but take first term to be n. Then a(n) is the two digit number surrounding the first comma, or -1 if there is no second term (and hence no comma).
a(n) (unless it -1) is called the comma-number of n.
As in A121805, if the term before the comma ends in 0, that 0 is ignored and the comma number is a single-digit number.

Examples

			For n = 1, A121805 begins 1, 12, 35, 94, ..., and the first comma appears as 1,1, so a(1) = 11.
For n = 2, A139284 begins 2, 24, 71, 89, ... and the first comma appears as 2,2, so a(2) = 22.
For n = 36, the commas sequence starting at 36 is simply the one-term sequence [36], no second term exists, there is no comma, and so a(36) = -1.
		

Crossrefs

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

A367346 Numbers k such that there is more than one possible solution for A367338(k).

Original entry on oeis.org

14, 33, 52, 71, 118, 227, 336, 445, 554, 663, 772, 881, 1918, 2927, 3936, 4945, 5954, 6963, 7972, 8981, 19918, 29927, 39936, 49945, 59954, 69963, 79972, 89981, 199918, 299927, 399936, 499945, 599954, 699963, 799972, 899981, 1999918, 2999927, 3999936, 4999945, 5999954, 6999963, 7999972, 8999981
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2023

Keywords

Comments

The number of solutions is either 0, 1, or 2.
The definition of A121805 instructs us to pick the smallest solution, so there is no ambiguity in the definition of A121805. The present sequence shows that there are very few cases where there is any possible ambiguity.
The sequence begins with the four exceptional terms 14, 33, 52, 71. It also includes all numbers with decimal expansions of the form d 9^i d (9-d), where juxtaposition is concatenation, ^ denotes repeated concatenation of digits, 1 <= d <= 8, and i >= 0, with associated next terms in the commas sequence being either d 9^(i+2) or (d+1) 0^(i+2). It is conjectured that there are no other terms. - Michael S. Branicky, Nov 16 2023
The conjecture is true; see link. - Michael S. Branicky, Nov 21 2023

Examples

			In the commas sequence starting at 14, the next term could be either 59 or 60, because both 14,59 and 14,60 satisfy the "commas" rule (since both 14 + 45 = 59 and 14 + 46 = 60).
		

Crossrefs

Programs

  • Mathematica
    fQ[n_]:=Module[{k=n+10*Last[IntegerDigits[n]]+Range[9]},Length[Select[k,#-n==FromDigits[{Last[IntegerDigits[n]],First[IntegerDigits[#]]}]&]]]>1;
    Select[Range[10^6],fQ[#]&] (* Ivan N. Ianakiev, Dec 16 2023 *)

Extensions

a(30) and beyond from Michael S. Branicky, Nov 16 2023
Second comment edited by N. J. A. Sloane, Nov 20 2023

A121805 The "comma sequence": the lexicographically earliest sequence of positive numbers with the property that the sequence formed by the pairs of digits adjacent to the commas between the terms is the same as the sequence of successive differences between the terms.

Original entry on oeis.org

1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, 530, 535, 590, 595, 651, 667, 744, 791, 809, 908, 997, 1068, 1149, 1240, 1241, 1252, 1273, 1304, 1345, 1396, 1457, 1528, 1609, 1700, 1701, 1712, 1733, 1764, 1805, 1856, 1917, 1988, 2070
Offset: 1

Views

Author

Eric Angelini, Dec 11 2006

Keywords

Comments

An equivalent, but more formal definition, is: a(1) = 1; for n > 1, let x be the least significant digit of a(n-1); then a(n) = a(n-1) + x*10 + y where y is the most significant digit of a(n) and is the smallest such y, if such a y exists. If no such y exists, stop.
The sequence contains exactly 2137453 terms, with a(2137453)=99999945. The next term does not exist. - W. Edwin Clark, Dec 11 2006
It is remarkable that the sequence persists for so long. - N. J. A. Sloane, Dec 15 2006
The similar sequence A139284, which starts at a(1)=2, persists even longer, ending at a(194697747222394) = 9999999999999918. - Giovanni Resta, Nov 30 2019
Conjecture: This sequence is finite, for any initial term. - N. J. A. Sloane, Nov 14 2023
The base 2 analog (suggested by William Cheswick) is 1, 4, 5, 8, 9, 12, 13, ..., (see A042948) with successive differences 3, 1, 3, 1, ... (repeat). - N. J. A. Sloane, Nov 15 2023
Does not satisfy Benford's Law. - Michael S. Branicky, Nov 16 2023
Using the notion of "comma transform" of a sequence, as defined in A367360, this is the lexicographically earliest sequence of positive integers with the property that its first differences and comma transform coincide. - N. J. A. Sloane, Nov 23 2023

Examples

			Replace each comma in the original sequence by the pair of digits adjacent to the comma; the result is the sequence of first differences between the terms of the sequence:
Sequence:   1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, ...
Differences: 11, 23, 59, 41 , 51 , 62 , 83 , 13 , 43 , 74 , 14 , ...
To illustrate the formula in the comment: a(6) = 186 and a(7) = 248 = 186 + 62.
		

References

  • Eric Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.

Crossrefs

See A366487 and A367349 for first differences.
Comma sequences in base 10, starting with 1, 2, 4, 5, 6, 7, 8, 9, 10 are A121805, A139284, A366492, A367337, A367350, A367351, A367352, A367353, A367354. Starting with 3 is trivial, and those starting with 11, 12, 13 are essentially duplicates.
Cf. A330128, A330129, A367338 (comma-successor), A367360.
See also A260261, A042948.

Programs

  • Maple
    digits:=n->ListTools:-Reverse(convert(n,base,10)):
    nextK:=proc(K) local i,L; for i from 0 to 9 do L:=K+digits(K)[ -1]*10+i; if i = digits(L)[1] then return L; fi; od; FAIL; end:
    A121805:=proc(n) option remember: if n = 1 then return 1; fi; return nextK(A121805(n-1)); end: # W. Edwin Clark
  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[x=Mod[a[n-1], 10]; y=0, y <= 9, y++, an = a[n-1] + 10*x + y; If[y == IntegerDigits[an][[1]], Return[an]]]; Array[a, 45] (* Jean-François Alcover, Nov 25 2014 *)
  • PARI
    a=1; for(n=1,1000, print1(a", "); a+=a%10*10; for(k=1, 9, digits(a+k)[1]==k&&(a+=k)&&next(2)); error("blocked at a("n")=",a-a%10*10)) \\ M. F. Hasler, Jul 21 2015
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, y = 1, 1
        while y < 10:
            yield an
            an, y = an + 10*(an%10), 1
            while y < 10:
                if str(an+y)[0] == str(y):
                    an += y
                    break
                y += 1
    print(list(islice(agen(), 45))) # Michael S. Branicky, Apr 08 2022
  • R
    A121805 <- data.frame(n=seq(from=1,to=2137453),a=integer(2137453)); A121805$a[1]=1; for (i in seq(from=2,to=2137453)){LSD=A121805$a[i-1] %% 10; k = 1; while (k != as.integer(substring(A121805$a[i-1]+LSD*10+k,1,1))){k = k+1; if(k>9) break} A121805$a[i]=A121805$a[i-1]+LSD*10+k} # Simon Demers, Oct 19 2017
    

Extensions

More terms from Zak Seidov, Dec 11 2006
Edited by N. J. A. Sloane, Sep 17 2023
Changed name from "commas sequence" to "comma sequence". - N. J. A. Sloane, Dec 20 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

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

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

A367614 a(n) is the unique k such that n is the comma-successor of k, or -1 if k does not exist.

Original entry on oeis.org

-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, 30, 21, 12, 3, -1, -1, -1, -1, -1, -1, -1, 40, 31, 22, 13, 4, -1, -1, -1, -1, -1, -1, 50, 41, 32, 23, 14, -1, 5, -1, -1, -1, -1, 60, 51, 42, 33, -1, 24, 15, 6, -1, -1, -1, 70, 61, 52, -1, 43, 34, 25, 16, 7
Offset: 1

Views

Author

N. J. A. Sloane, Dec 16 2023

Keywords

Comments

If k exists, it could be called the comma-predecessor of n.
a(n) is the unique k such that A367338(k) = n, or -1.
a(n) = -1 iff n is in A367600.

Crossrefs

Programs

  • Python
    def a(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
    print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Dec 16 2023

A367600 Numbers that are not the comma-successor of any number.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 32, 37, 38, 39, 40, 41, 42, 43, 49, 50, 51, 52, 53, 54, 60, 62, 63, 64, 65, 70, 74, 75, 76, 80, 86, 87, 90, 98, 200, 300, 400, 500, 600, 700, 800, 900, 2000, 3000, 4000, 5000, 6000, 7000
Offset: 1

Views

Author

Giovanni Resta, Nov 23 2023

Keywords

Comments

These are the positive integers that do not appear in A367338.
All terms > 98 are of the form c*10^i for i >= 2 and 2 <= c <= 9; see proof in links. - Michael S. Branicky, Nov 28 2023

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A367338(n):
        nn = n + 10*(n%10)
        return next((nn+y for y in range(1, 10) if str(nn+y)[0] == str(y)), -1)
    def agen():
        A367338_set = set()
        for n in count(1):
            A367338_set.add(A367338(n))
            if n not in A367338_set:
                yield n
            # A367338_set.discard(n-100) # uncomment if memory is an issue
    print(list(islice(agen(), 86))) # Michael S. Branicky, Nov 28 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
Showing 1-10 of 22 results. Next