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!)
A370401 Lexicographically earliest sequence of distinct nonnegative terms such that the first digit of a(n) is present in a(n+1). 6
0, 10, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 2, 20, 22, 23, 24, 25, 26, 27, 28, 29, 32, 3, 30, 31, 33, 34, 35, 36, 37, 38, 39, 43, 4, 40, 41, 42, 44, 45, 46, 47, 48, 49, 54, 5, 50, 51, 52, 53, 55, 56, 57, 58, 59, 65, 6, 60, 61, 62, 63, 64, 66, 67, 68, 69, 76, 7, 70, 71, 72, 73, 74, 75, 77, 78, 79, 87, 8, 80 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Eric Angelini, Talking to me?, personal blog, Feb 2024.
EXAMPLE
a(1) = 0 and the leftmost digit "0" is present in the next term (10)
a(2) = 10 and the leftmost digit "1" is present in the next term ( 1)
a(3) = 1 and the leftmost digit "1" is present in the next term (11)
a(4) = 11 and the leftmost digit "1" is present in the next term (12)
a(5) = 12 and the leftmost digit "1" is present in the next term (13), etc.
MATHEMATICA
a[1]=0; a[n_]:=a[n]=(k=1; While[MemberQ[Array[a, n-1], k]|| FreeQ[IntegerDigits@k, First@IntegerDigits@a[n-1]], k++]; k); Array[a, 81]
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
an, aset, mink = 0, set(), 1
while True:
yield an
aset.add(an)
t, k = str(an)[0], mink
an = next(k for k in count(mink) if k not in aset and t in str(k))
while mink in aset: mink += 1
print(list(islice(agen(), 81))) # Michael S. Branicky, Feb 18 2024
CROSSREFS
Sequence in context: A107353 A297418 A297352 * A172171 A327723 A164899
KEYWORD
base,nonn
AUTHOR
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 May 7 13:07 EDT 2024. Contains 372303 sequences. (Running on oeis4.)