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!)
A370400 Lexicographically earliest sequence of distinct nonnegative terms such that the last digit of a(n) is present in a(n+1). 6
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 1, 11, 12, 2, 21, 13, 3, 23, 31, 14, 4, 24, 34, 41, 15, 5, 25, 35, 45, 51, 16, 6, 26, 36, 46, 56, 61, 17, 7, 27, 37, 47, 57, 67, 71, 18, 8, 28, 38, 48, 58, 68, 78, 81, 19, 9, 29, 39, 49, 59, 69, 79, 89, 91, 102, 22, 32, 42, 52, 62, 72, 82, 92, 112, 120, 103, 33 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This is not A156819.
LINKS
Eric Angelini, Talking to me?, personal blog, Feb 2024.
EXAMPLE
a(12) = 101 and the rightmost digit "1" is present in the next term ( 1)
a(13) = 1 and the rightmost digit "1" is present in the next term (11)
a(14) = 11 and the rightmost digit "1" is present in the next term (12)
a(15) = 12 and the rightmost digit "2" is present in the next term ( 2)
a(16) = 2 and the rightmost digit "2" is present in the next term (21)
a(17) = 21 and the rightmost 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, Mod[a[n-1], 10]], k++]; k); Array[a, 79]
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%10), 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(), 79))) # Michael S. Branicky, Feb 18 2024
CROSSREFS
Sequence in context: A338641 A337857 A044895 * A156819 A139079 A360443
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 August 13 11:55 EDT 2024. Contains 375138 sequences. (Running on oeis4.)