login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest numbers containing exactly n smaller numbers when written as English number names.
2

%I #13 Feb 14 2024 14:14:41

%S 0,14,21,61,414,114,122,161,162,4414,1114,1122,1223,1161,1162,1263,

%T 14162,21114,21132,21233,26666,21161,21162,21263,61273,114261,114263,

%U 121233,122334,121161,121162,121261,121263,122364,161273,162374,1114261,1114263,1122334

%N Smallest numbers containing exactly n smaller numbers when written as English number names.

%C A159451(a(n)) = n and A159451(m) <> n for m < a(n).

%H Michael S. Branicky, <a href="/A159453/b159453.txt">Table of n, a(n) for n = 0..80</a>

%H Michael S. Branicky, <a href="/A159453/a159453_1.txt">Table of n, a(n) and the contained number words for n = 0..80</a>

%H Michael S. Branicky, <a href="/A159453/a159453.txt">Python program</a>

%H Robert G. Wilson v, <a href="/A000027/a000027.txt">English names for the numbers from 0 to 11159 without spaces or hyphens</a>

%e a(0)=0->zero: A159451(0)=#{}=0;

%e a(1)=14->fourteen: A159451(14)=#{4}=1;

%e a(2)=21->twentyone: A159451(21)=#{1,20}=2;

%e a(3)=61->sixtyone: A159451(61)=#{1,6,60}=3;

%e a(4)=414->fourhundredfourteen: A159451(414)=#{4,14,400,404}=4;

%e a(5)=114->onehundredfourteen: A159451(114)=#{1,4,14,100,104}=5;

%e a(6)=122->onehundredtwentytwo: A159451(122)=#{1,2,20,22,100,120}=6;

%e a(7)=161->onehundredsixtyone: A159451(161)=#{1,6,60,61,100,106,160}=7;

%e a(8)=162->onehundredsixtytwo: A159451(162)=#{1,2,6,60,62,100,106,160}=8;

%e a(9)=4414->fourthousandfourhundredfourteen: A159451(4414)=#{4,14,400,404,414,4000,4004,4400,4404}=9;

%e a(10)=1114->onethousandonehundredfourteen: A159451(1114)=#{1,4,14,100,104,114,1000,1001,1100,1104}=10;

%e a(11)=1122->onethousandonehundredtwentytwo: A159451(1122)=#{1,2,20,22,100,120,122,1000,1001,1100,1120}=11;

%e a(12)=1223->onethousandtwohundredtwentythree: A159451(1223)=#{1,2,3,20,23,200,220,223,1000,1002,1200,1220}=12;

%e a(13)=1161->onethousandonehundredsixtyone: A159451(1161)=#{1,6,60,61,100,106,160,161,1000,1001,1100,1106,1160}=13;

%e a(14)=1162->onethousandonehundredsixtytwo: A159451(1162)=#{1,2,6,60,62,100,106,160,162,1000,1001,1100,1106,1160}=14;

%e a(15)=1263->onethousandtwohundredsixtythree: A159451(1263)=#{1,2,3,6,60,63,200,206,260,263,1000,1002,1200,1206,1260}=15.

%o (Python) # see Links for a faster version

%o from num2words import num2words

%o from itertools import count, islice

%o def n2w(n):

%o map = {ord(c): None for c in "-, "}

%o return num2words(n).replace(" and", "").translate(map)

%o def agen(): # generator of terms

%o W, adict, n = set(), dict(), 0

%o for m in count(0):

%o w = n2w(m)

%o v = len(set(w[i:j] for i in range(len(w)) for j in range(i+1, len(w)+1) if w[i:j] in W))

%o if v not in adict: adict[v] = m

%o while n in adict: yield adict[n]; n += 1

%o W.add(w)

%o print(list(islice(agen(), 24))) # _Michael S. Branicky_, Feb 13 2024

%Y Cf. A000027, A159451, A159452.

%K nonn,word

%O 0,2

%A _Reinhard Zumkeller_, Apr 12 2009

%E a(16) and beyond from _Michael S. Branicky_, Feb 13 2024