|
|
A370402
|
|
Lexicographically earliest sequence of distinct nonnegative terms such that the last digit of a(n) is present in a(n+1) and the last letter of the English name of a(n) is present in the English name of a(n+1).
|
|
6
|
|
|
0, 40, 20, 30, 50, 60, 70, 80, 90, 120, 130, 140, 150, 160, 170, 180, 190, 220, 230, 240, 250, 260, 270, 280, 290, 320, 330, 340, 350, 360, 370, 380, 390, 420, 430, 440, 450, 460, 470, 480, 490, 520, 530, 540, 550, 560, 570, 580, 590, 620, 630, 640, 650, 660, 670, 680, 690, 720, 730, 740, 750, 760, 770, 780
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
When will the first integer not ending in zero appear?
|
|
LINKS
|
|
|
EXAMPLE
|
0 zero, 40 forty, 20 twenty, 30 thirty, 50 fifty, 60 sixty, 70 seventy, 80 eighty, 90 ninety, 120 one hundred twenty, 130 one hundred thirty, 140 one hundred forty, 150 one hundred fifty, 160 one hundred sixty, 170 one hundred seventy, 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]]|| !StringContainsQ[IntegerName[k, "Words"], Last@Characters@IntegerName[a[n-1], "Words"]], k++]; k); Array[a, 64]
|
|
PROG
|
(Python)
from num2words import num2words
from itertools import count, islice
def name(n): return num2words(n).replace(" and", "")
def agen(): # generator of terms
an, aset, mink = 0, set(), 1
while True:
yield an
aset.add(an)
t1, t2, k = str(an%10), name(an)[-1], mink
an = next(k for k in count(mink) if k not in aset and t1 in str(k) and t2 in name(k))
while mink in aset: mink += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn,word
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|