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.

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