[go: up one dir, main page]

login
A337707
a(n) is the lowest number in the sequence of the first occurrence of exactly n consecutive numbers with at least one repeated digit, or -1 if no such number exists.
1
11, 121, 99, 1898, 12898, 123898, 1234898, 12345898, 123456898, 110, 1909, 10330, 9188, 9088, 19787, 129787, 1239787, 12349787, 123459787, 1210, 12909, 103430, 1024540, 2988, 1988, 27987, 237987, 2347987, 23457987, 12310, 123909, 1034530, 10245640, 102356750, 988, 12988
OFFSET
1,1
COMMENTS
Terms computed by Claudio Meller.
Does the term -1 first appear at a(55)?
All terms < 9876543210. - Robert Israel, Jan 14 2022
LINKS
Michel Marcus, Positions and lengths
Michel Marcus, Lengths and positions
EXAMPLE
a(3) = 99 is the smallest number in the first appearance sequence of 3 consecutive numbers with repeated digits, 99, 100 and 101, a(15) = 19787 is the smallest number in the first appearance sequence of 15 consecutive numbers with repeated digits that starts in 19787 and finish in 19801 (19802 has no repeated digits).
PROG
(PARI) isokd(n) = my(d=digits(n)); #d != #Set(d); \\ A109303
isok(k, n) = {if (! isokd(k-1), for (i=k, k+n-1, if (! isokd(i), return (0)); ); ! isokd(k+n); ); }
a(n) = {my(k=1); while (!isok(k, n), k++); k; } \\ Michel Marcus, Jan 13 2022
(PARI) lista(nn) = {my(map=Map(), r=isokd(1), nb, k, nbmax=0); for (n=2, nn, my(rr = isokd(n)); if (r, if (rr, nb++, if (! mapisdefined(map, nb), mapput(map, nb, k)); nb=0), if (rr, nb=1; k=n, nb=0); ); r = rr; ); map; } \\ Michel Marcus, Jan 14 2022
CROSSREFS
Cf. A109303.
Sequence in context: A004190 A089707 A223391 * A084969 A045592 A045595
KEYWORD
base,nonn
AUTHOR
Rodolfo Kurchan, Sep 26 2020
STATUS
approved