login
Number of "e"s in n (in English).
6

%I #18 Dec 20 2019 19:03:15

%S 1,1,0,2,0,1,0,2,1,1,1,3,2,2,2,2,2,4,3,3,1,2,1,3,1,2,1,3,2,2,0,1,0,2,

%T 0,1,0,2,1,1,0,1,0,2,0,1,0,2,1,1,0,1,0,2,0,1,0,2,1,1,0,1,0,2,0,1,0,2,

%U 1,1,2,3,2,4,2,3,2,4,3,3,1,2,1,3,1,2,1,3,2,2,1,2,1,3,1,2,1,3,2,2

%N Number of "e"s in n (in English).

%C a(A006933(n)) = 0; a(A008520(n)) > 0. - _Reinhard Zumkeller_, Jan 23 2015

%C a(A006933(n)) = 0; a(A008520(n)) > 0; a(A121065(n)) = n and a(m) != n for m < A121065(n). - _Reinhard Zumkeller_, Jan 24 2015

%H Reinhard Zumkeller, <a href="/A085513/b085513.txt">Table of n, a(n) for n = 0..10000</a>

%H Roel and Bas van Dijk, <a href="http://hackage.haskell.org/package/numerals">Numerals package</a>, Hackage (Haskell packages)

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

%H <a href="/index/Lc#letters">Index entries for sequences related to number of letters in n</a>

%e a(123) = 5 because "onE hundrEd twEnty-thrEE" has 5 e's.

%t StringCount[IntegerName/@Range[0,99],"e"] (* _Ivan N. Ianakiev_, Mar 25 2017 *)

%o (Haskell)

%o import Data.Maybe (fromJust)

%o import Data.Text (Text); import qualified Data.Text as T (unpack))

%o import Text.Numeral.Grammar.Reified (defaultInflection)

%o import qualified Text.Numeral.Language.EN as EN -- see link

%o a085513 = length . filter (== 'e') . T.unpack . numeral where

%o numeral :: Integer -> Text

%o numeral = fromJust . EN.gb_cardinal defaultInflection

%o -- _Reinhard Zumkeller_, Jan 23 2015

%o (Python)

%o from num2words import num2words

%o def A085513(n):

%o return num2words(n).count('e') # _Chai Wah Wu_, Dec 20 2019

%Y Cf. A005589.

%Y Cf. A006933, A008520.

%K easy,nonn,word

%O 0,4

%A Samuel Thompson (samuelt(AT)ugcs.caltech.edu), Jul 03 2003