OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Eric Angelini, Talking to me?, personal blog, Feb 2024.
EXAMPLE
1 one, 14 fourteen, 15 fifteen, 41 forty-one, 4 four, 24 twenty-four, 2 two, 12 twelve, 10 ten 13 thirteen, 16 sixteen, 17 seventeen, 61 sixty-one, 6 six, 60 sixty, 26 twenty-six, 20 twenty, 21 twenty-one, etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[MemberQ[Array[a, n-1], k]|| FreeQ[IntegerDigits@k, First@IntegerDigits@a[n-1]]|| !StringContainsQ[IntegerName[k, "Words"], First@Characters@IntegerName[a[n-1], "Words"]], k++]; k); Array[a, 81]
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 = 1, set(), 1
while True:
yield an
aset.add(an)
t1, t2, k = str(an)[0], name(an)[0], 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
print(list(islice(agen(), 82))) # Michael S. Branicky, Feb 18 2024
CROSSREFS
KEYWORD
base,nonn,word
AUTHOR
Eric Angelini and Giorgos Kalogeropoulos, Feb 17 2024
STATUS
approved