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

A330128 a(n) is the number of terms in the analog of A121805 but starting with n, or -1 if that sequence is infinite.

Original entry on oeis.org

2137453, 194697747222394, 2, 199900, 19706, 209534289952018960, 15, 198104936410, 19511030, 20573, 20572, 2137452, 20534, 19238, 2, 2089707, 20670629294, 1, 21482, 19278442756937613, 2074, 19278442756937612, 20571, 194697747222393, 193, 197062, 1, 197, 2061823
Offset: 1

Views

Author

Giovanni Resta, Dec 02 2019

Keywords

Comments

The final terms of the corresponding sequences are given in A330129.

Crossrefs

Cf. A330129 (corresponding last term), A121805, A139284, A366492.
For record high points see A367364 and A367365.

Programs

  • Mathematica
    nxt[x_] := Block[{p=1, n=x}, While[n >= 10, n = Floor[n/10]; p *= 10]; p (n + 1)]; a[n_] := Block[{nT=1, nX=n, w1, w2, w3, x, it, stp, oX}, stp = 100; w1 = w2 = w3 = 0; While[True, oX = nX; nT++; x = 10*Mod[oX, 10]; nX = SelectFirst[Range[9], IntegerDigits[oX + x + #][[1]] == # &, 0]; If[nX == 0, Break[], nX = nX + oX + x]; If[nT == stp, stp += 100; w1=w2; w2=w3; w3=nX; If[w3 + w1 == 2 w2 && Mod[w3 - w2, 100] == 0, it = Floor[(nxt[nX] - nX - 1)/(w3 - w2)]; nT += it*100; nX += (w3 - w2)*it; w3=nX; stp += it*100]]]; nT - 1]; Array[a, 30]
  • Python
    def nxt(x):
        p, n = 1, x
        while n >= 10:
            n //= 10
            p *= 10
        return p * (n + 1)
    def a(n):
        nT, nX, w1, w2, w3, stp  = 1, n, 0, 0, 0, 100
        while True:
            oX = nX
            nT += 1
            x = 10*(oX%10)
            nX = next((y for y in range(1, 10) if str(oX+x+y)[0] == str(y)), 0)
            if nX == 0: break
            else: nX += oX + x
            if nT == stp:
                stp += 100
                w1, w2, w3 = w2, w3, nX
                if w3 + w1 == 2*w2 and (w3 - w2)%100 == 0:
                    it = (nxt(nX) - nX - 1)//(w3 - w2)
                    nT += it*100
                    nX += (w3 - w2)*it
                    w3 = nX
                    stp += it*100
        return nT - 1
    print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Nov 18 2023 after Giovanni Resta

Extensions

Escape clause added to definition by N. J. A. Sloane, Nov 14 2023

A330129 a(n) is the last term of the analogous sequence to A121805, but with initial term n, or -1 if that sequence is infinite.

Original entry on oeis.org

99999945, 9999999999999918, 36, 9999945, 999945, 9999999999999999936, 936, 9999999999972, 999999936, 999936, 999936, 99999945, 999954, 999918, 72, 99999918, 999999999927, 18, 999981, 999999999999999963, 99981, 999999999999999963, 999936, 9999999999999918, 9963
Offset: 1

Views

Author

Giovanni Resta, Dec 02 2019

Keywords

Comments

The numbers of terms of the corresponding sequences are in A330128.

Crossrefs

Programs

  • Mathematica
    nxt[x_] := Block[{p=1, n=x}, While[n >= 10, n = Floor[n/10]; p *= 10]; p (n + 1)]; a[n_] := Block[{nT=1, nX=n, w1, w2, w3, x, it, stp, oX}, stp = 100; w1 = w2 = w3 = 0; While[True, oX = nX; nT++; x = 10*Mod[oX, 10]; nX = SelectFirst[Range[9], IntegerDigits[oX + x + #][[1]] == # &, 0]; If[nX == 0, Break[], nX = nX + oX + x]; If[nT == stp, stp += 100; w1=w2; w2=w3; w3=nX; If[w3 + w1 == 2 w2 && Mod[w3 - w2, 100] == 0, it = Floor[(nxt[nX] - nX - 1)/(w3 - w2)]; nT += it*100; nX += (w3 - w2)*it; w3=nX; stp += it*100]]]; oX]; Array[a, 30]
  • Python
    def nxt(x):
        p, n = 1, x
        while n >= 10:
            n //= 10
            p *= 10
        return p * (n + 1)
    def a(n):
        nT, nX, w1, w2, w3, stp  = 1, n, 0, 0, 0, 100
        while True:
            oX = nX
            nT += 1
            x = 10*(oX%10)
            nX = next((y for y in range(1, 10) if str(oX+x+y)[0] == str(y)), 0)
            if nX == 0: break
            else: nX += oX + x
            if nT == stp:
                stp += 100
                w1, w2, w3 = w2, w3, nX
                if w3 + w1 == 2*w2 and (w3 - w2)%100 == 0:
                    it = (nxt(nX) - nX - 1)//(w3 - w2)
                    nT += it*100
                    nX += (w3 - w2)*it
                    w3 = nX
                    stp += it*100
        return oX
    print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Nov 18 2023 after Giovanni Resta

Extensions

Escape clause added to definition by N. J. A. Sloane, Nov 14 2023

A139284 Analog of A121805, but starting with 2.

Original entry on oeis.org

2, 24, 71, 89, 180, 181, 192, 214, 256, 319, 413, 447, 522, 547, 623, 659, 756, 824, 872, 901, 920, 929, 1020, 1021, 1032, 1053, 1084, 1125, 1176, 1237, 1308, 1389, 1480, 1481, 1492, 1513, 1544, 1585, 1636, 1697, 1768, 1849, 1940, 1941, 1952, 1973, 2005
Offset: 1

Views

Author

N. J. A. Sloane (based on Angelini's article), Jun 08 2008

Keywords

Comments

It appears that this sequence and A121805 have no terms in common. Furthermore, this sequence exists for at least 1551000000 terms. - Jacques ALARDET, Jul 22 2008
The last term of the sequence is a(194697747222394) = 9999999999999918. - Giovanni Resta, Nov 30 2019

References

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

Crossrefs

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.

Programs

  • Maple
    a:= proc(n) option remember; local k, t, y; if n=1 then 2 else k:= a(n-1); for y from 0 to 9 do t:= k +10* irem (k, 10) +y; if convert (t, base, 10)[ -1]=y then return t fi od; NULL fi end: seq(a(n), n=1..80); # Alois P. Heinz, Aug 13 2009
  • Mathematica
    a[1] = 2; 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, 80] (* Jean-François Alcover, Nov 25 2014 *)
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, y = 2, 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(), 47))) # Michael S. Branicky, Apr 08 2022

Extensions

More terms from Alois P. Heinz, Aug 13 2009

A366492 Analog of A121805, but starting with 4.

Original entry on oeis.org

4, 48, 129, 221, 233, 265, 318, 402, 426, 490, 494, 539, 635, 691, 708, 795, 853, 891, 910, 919, 1010, 1011, 1022, 1043, 1074, 1115, 1166, 1227, 1298, 1379, 1470, 1471, 1482, 1503, 1534, 1575, 1626, 1687, 1758, 1839, 1930, 1931, 1942, 1963, 1994, 2036, 2098, 2180, 2182
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2023

Keywords

Comments

If instead we start with 3, the sequence is the two-term sequence [3, 36].
The present sequence is finite, with last term a(199900) = 9999945.

Crossrefs

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.

Programs

  • Python
    from itertools import islice
    def agen(start=4): # generator of terms
        an, y = start, 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(), 50))) # Michael S. Branicky, Nov 18 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

A367355 Comma sequence, analogous to A121805, starting at 1, but the calculations are done in base 3.

Original entry on oeis.org

1, 5, 12, 13, 17, 25, 29, 36, 37, 41, 48, 49, 53, 61, 66, 68, 76
Offset: 1

Views

Author

N. J. A. Sloane, Nov 18 2023

Keywords

Crossrefs

A367605 and A367605 give the length and last term for the analogous sequence in base b.

Programs

  • Maple
    # Comma Successor in Maple in base "bas", from N. J. A. Sloane, Dec 06 2023
    bas := 3;
    Ldigit:=proc(n) local v; v:=convert(n, base, bas); v[-1]; end; # Returns leading digit
    # Return comma-successor to a or -1 if no successor exists
    commsucc := proc(a) local f,i,d;
    f := (a mod bas);
    d:=bas*f;
    for i from 1 to bas-1 do
    d := d+1;
    if Ldigit(a+d) = i then return(a+d); fi;
    od:
    return(-1);
    end;
    a:=[1]; s:=1; for n from 1 to 16 do s:=commsucc(s); a:=[op(a),s]; od: a;

A367337 Analog of A121805, but starting with 5.

Original entry on oeis.org

5, 61, 78, 159, 251, 263, 295, 348, 432, 456, 521, 536, 602, 628, 715, 772, 799, 897, 976, 1037, 1108, 1189, 1280, 1281, 1292, 1313, 1344, 1385, 1436, 1497, 1568, 1649, 1740, 1741, 1752, 1773, 1804, 1845, 1896, 1957, 2029, 2121, 2133, 2165, 2217, 2289, 2381, 2393, 2425
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2023

Keywords

Comments

This sequence is finite, with last term a(19706) = 999945.

Crossrefs

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.

Programs

  • Python
    from itertools import islice
    def agen(start=5): # generator of terms
        an, y = start, 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(agen())) # Michael S. Branicky, Nov 18 2023

A367350 Analog of A121805, but starting with 6.

Original entry on oeis.org

6, 73, 104, 145, 196, 258, 341, 354, 397, 471, 485, 540, 545, 601, 617, 693, 730, 737, 815, 873, 912, 941, 960, 969, 1060, 1061, 1072, 1093, 1124, 1165, 1216, 1277, 1348, 1429, 1520, 1521, 1532, 1553, 1584, 1625, 1676, 1737, 1808, 1889, 1980, 1981, 1992, 2014, 2056, 2118
Offset: 1

Views

Author

N. J. A. Sloane, Nov 17 2023

Keywords

Comments

Contains 209534289952018960 terms, the last term being a(209534289952018960) = 9999999999999999936.

Crossrefs

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.

Programs

  • Mathematica
    b = 10; m = b - 1; a[1] = 6; a[n_] := a[n] = For[r = Mod[a[n - 1], b]; y = 0, y <= m, y++, If[y == IntegerDigits[#, b][[1]], Return[#]] &[a[n - 1] + b r + y]]; Array[a, 45] (* Michael De Vlieger, Nov 18 2023, after Jean-François Alcover at A121805 *)
  • Python
    from itertools import count, islice
    def agen(start=6): # generator of terms
        an, y = start, 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(), 50))) # Michael S. Branicky, Nov 18 2023

A367351 Analog of A121805, but starting with 7.

Original entry on oeis.org

7, 85, 136, 197, 269, 362, 385, 439, 534, 579, 675, 732, 759, 857, 936
Offset: 1

Views

Author

N. J. A. Sloane, Nov 17 2023

Keywords

Crossrefs

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.

Programs

  • Mathematica
    b = 10; m = b - 1; a[1] = 7; a[n_] := a[n] = For[r = Mod[a[n - 1], b]; y = 0, y <= m, y++, If[y == IntegerDigits[#, b][[1]], Return[#]] &[a[n - 1] + b r + y]]; TakeWhile[Array[a, 45], IntegerQ] (* Michael De Vlieger, Nov 18 2023, after Jean-François Alcover at A121805 *)
  • Python
    def agen(start=7): # generator of terms
        an, y = start, 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(agen())) # Michael S. Branicky, Nov 18 2023

A367352 Analog of A121805, but starting with 8.

Original entry on oeis.org

8, 97, 168, 250, 252, 274, 317, 390, 393, 427, 502, 527, 603, 639, 736, 804, 852, 880, 888, 977, 1048, 1129, 1220, 1221, 1232, 1253, 1284, 1325, 1376, 1437, 1508, 1589, 1680, 1681, 1692, 1713, 1744, 1785, 1836, 1897, 1968, 2050, 2052, 2074, 2116, 2178, 2260, 2262, 2284
Offset: 1

Views

Author

N. J. A. Sloane, Nov 17 2023

Keywords

Comments

Contains 198104936410 terms, the last being 9999999999972.

Crossrefs

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.

Programs

  • Mathematica
    b = 10; m = b - 1; a[1] = 8; a[n_] := a[n] = For[r = Mod[a[n - 1], b]; y = 0, y <= m, y++, If[y == IntegerDigits[#, b][[1]], Return[#]] &[a[n - 1] + b r + y]]; Array[a, 45] (* Michael De Vlieger, Nov 18 2023, after Jean-François Alcover at A121805 *)
  • Python
    from itertools import islice
    def agen(start=8): # generator of terms
        an, y = start, 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(), 50))) # Michael S. Branicky, Nov 18 2023
Showing 1-10 of 72 results. Next