Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
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!)
Search: a331215 -id:a331215
Displaying 1-2 of 2 results found. page 1
     Sort: relevance | references | number | modified | created      Format: long | short | data
A331975 Lexicographically earliest sequence of distinct positive integers such that three successive digits are always distinct. +10
3
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 30, 12, 31, 20, 13, 24, 15, 23, 14, 25, 16, 27, 18, 26, 17, 28, 19, 32, 40, 29, 34, 50, 35, 41, 36, 42, 37, 43, 51, 38, 45, 39, 46, 52, 47, 53, 48, 54, 60, 49, 56, 70, 57, 61, 58, 62, 59, 63, 71, 64, 72, 65, 73, 67, 80, 68, 74, 69, 75, 81, 76, 82, 78, 90, 79, 83, 91, 84 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
As a(10) = 10, a(11) cannot start with a 1 or have a 0 in second position; thus a(11) = 21;
as a(11) = 21, a(12) cannot start with a 1 or a 2; thus a(12) = 30;
as a(12) = 30, a(13) = 12, smallest available integer not leading to an immediate contradiction;
as a(13) = 12, a(14) cannot start with 1 or 2; thus a(14) = 31, smallest available integer not leading to an immediate contradiction. Etc.
PROG
(Python)
from itertools import islice
def ok(s): return all(len(set(s[i:i+3]))==3 for i in range(len(s)-2))
def agen(): # generator of terms
aset, s, k, mink = {1}, "x1", 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))[-3:]
while mink in aset: mink += 1
print(list(islice(agen(), 79))) # Michael S. Branicky, Jun 30 2022
CROSSREFS
Cf. A331215 (a variant with 4 successive distinct digits instead of 3).
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 03 2020
STATUS
approved
A331989 Lexicographically earliest sequence of distinct positive integers such that five successive digits are always distinct. +10
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 41, 50, 24, 13, 52, 40, 15, 26, 30, 12, 43, 51, 20, 34, 16, 25, 31, 42, 53, 14, 27, 35, 18, 29, 36, 17, 28, 39, 45, 21, 37, 46, 19, 32, 47, 56, 38, 49, 57, 60, 48, 59, 61, 70, 54, 62, 71, 58, 63, 72, 80, 64, 73, 81, 65, 74, 82, 67, 90, 83, 69, 75, 84, 91, 68, 79, 102, 76, 85 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
The 5 digits 1, 0, 2, 3, 4 of a(10), a(11) and the 1st digit of a(12) are distinct;
the 5 digits 0, 2, 3, 4, 1 of the 2nd digit of a(10), a(11) and a(12) are distinct;
the 5 digits 2, 3, 4, 1, 5 of a(11), a(12) and the 1st digit of a(13) are distinct;
the 5 digits 3, 4, 1, 5, 0 of the 2nd digit of a(11), a(12) and a(13) are distinct;
the 5 digits 4, 1, 5, 0, 2 of a(12), a(13) and the 1st digit of a(14) are distinct, etc.
CROSSREFS
Cf. A331975 (a variant with 3 successive distinct digits), A331215 (a variant with 4 successive distinct digits).
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 03 2020
STATUS
approved
page 1

Search completed in 0.006 seconds

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 September 12 09:47 EDT 2024. Contains 375850 sequences. (Running on oeis4.)