%I #21 Apr 04 2021 00:47:47
%S 4,3,3,4,4,4,3,4,5,3,3,4,5,6,7,5,6,5,6,4,5,6,6,7,9,8,8,7,8,6,5,8,7,6,
%T 8,8,7,9,7,7,5,7,6,7,6,8,8,9,9,8,4,7,6,7,7,6,6,8,7,6,5,8,7,8,9,8,5,8,
%U 8,7,6,7,8,8,10,8,8,6,9,7,6,8,8,7,10,8,8,9,6,7,5,6,7,7,9,7,7,7
%N Number of distinct letters in the (American) English name of n, excluding spaces and hyphens.
%C First occurrence of k=3..23: 1, 0, 8, 13, 14, 25, 24, 74, 112, 127, 125, 165, 265, 1265, 2568, 12468, 1002568, 1001002568, 1000001001002568, 1000000001000001001002568, 1001000000001000001001002568.
%C Since there are no number words consisting of just one or two letters, nor any number words which contain the letters "j", "k" or "z"; the above list is complete.
%F a(n) <= A005589(n).
%e a(7) = 4 since "seven" has 4 distinct letters. (Cf. A005589(7) = 5.)
%t f[n_] := Length@ Union@ StringPartition[ StringReplace[ IntegerName[n, "Words"], ", " | " " | "\[Hyphen]" -> ""], 1]; Array[f, 98, 0]
%o (Python)
%o from num2words import num2words
%o def n2w(n):
%o map = {ord(c): None for c in "-, "}
%o return num2words(n).replace(" and", "").translate(map)
%o def a(n): return len(set(n2w(n)))
%o print([a(n) for n in range(98)]) # _Michael S. Branicky_, Apr 03 2021
%Y Cf. A005589.
%K nonn,word
%O 0,1
%A _Robert G. Wilson v_, Apr 29 2018
|