login
A160658
Numbers that have the letter "n" in the middle of their names when written in American English.
3
1, 17, 193, 197, 198, 293, 297, 298, 301, 302, 306, 310, 693, 697, 698, 701, 702, 706, 710, 801, 802, 806, 810, 1013, 1014, 1018, 1019, 1041, 1042, 1046, 1051, 1052, 1056, 1061, 1062, 1066, 1104, 1105, 1109, 1173, 1177, 1178, 1273, 1277, 1278, 1673, 1677, 1678
OFFSET
1,2
EXAMPLE
oNe, seveNteen, onehundredNinetythree, ...
MATHEMATICA
ok[n_] := Block[{s = StringReplace[IntegerName[n, "Words"], ", " | " " | "\[Hyphen]" -> ""], m}, m = StringLength[s]; OddQ[m] && (m = (m + 1)/2; StringTake[s, {m, m}] == "n")]; Select[Range[5000], ok] (* Giovanni Resta, May 01 2017 *)
PROG
(Python)
from num2words import num2words
def middle(s): return s[len(s)//2] if len(s)%2 == 1 else None
def n2w(n):
map = {ord(c): None for c in "-, "}
return num2words(n).replace(" and", "").translate(map)
def aupto(nn): return [n for n in range(1, nn+1) if middle(n2w(n)) == 'n']
print(aupto(1678)) # Michael S. Branicky, Jan 17 2021
CROSSREFS
KEYWORD
nonn,word,less
AUTHOR
Claudio Meller, May 22 2009
EXTENSIONS
a(24)-a(47) from Giovanni Resta, May 01 2017
STATUS
approved