login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A331215 Lexicographically earliest sequence of distinct positive integers such that four successive digits are always distinct. 3
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 14, 20, 13, 24, 15, 26, 17, 25, 16, 27, 18, 29, 30, 12, 34, 19, 28, 31, 40, 21, 35, 41, 32, 45, 36, 42, 37, 46, 38, 47, 39, 48, 50, 43, 51, 49, 52, 60, 53, 61, 54, 62, 57, 63, 58, 64, 59, 67, 80, 56, 70, 81, 65, 71, 68, 72, 69, 73, 82, 74, 83, 75, 84, 76, 85, 79, 86, 102 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This is not A276766, though the first 63 terms are the same.
LINKS
EXAMPLE
The four digits of a(11) = 23 and a(12) = 14 are distinct;
the four digits of a(12) = 14 and a(13) = 20 are distinct;
but so are also the successive digits 3,1,4,2 visible in 23, 14, 20;
the four digits of a(13) = 20 and a(14) = 13 are distinct;
the four digits of a(14) = 13 and a(15) = 24 are distinct;
but so are also the successive digits 0,1,3,2 visible in 20,13,24; etc.
PROG
(Python)
from itertools import islice
def ok(s): return all(len(set(s[i:i+4]))==4 for i in range(len(s)-3))
def agen(): # generator of terms
aset, s, k, mink = {1}, "xy1", 1, 2
while True:
yield k
k, avoid = mink, set(s)
while k in aset or not ok(s + str(k)): k += 1
aset.add(k)
s = (s + str(k))[-4:]
while mink in aset: mink += 1
print(list(islice(agen(), 79))) # Michael S. Branicky, Jun 30 2022
CROSSREFS
Cf. A331975 (a variant with 3 successive distinct digits instead of 4), A276766.
Sequence in context: A114806 A239664 A276766 * A039229 A054659 A331989
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 03 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)