OFFSET
1,3
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Roel and Bas van Dijk, Numerals package, Hackage (Haskell packages)
PROG
(Haskell)
-- import Data.Maybe (fromJust)
import Data.Text (Text); import qualified Data.Text as T (all)
import Text.Numeral.Grammar.Reified (defaultInflection)
import qualified Text.Numeral.Language.EN as EN -- see link
a008523 n = a008523_list !! (n-1)
a008523_list = filter (T.all (/= 't') . numeral) [0..] where
numeral :: Integer -> Text
numeral = fromJust . EN.gb_cardinal defaultInflection
-- Reinhard Zumkeller, Jan 23 2015
(Python)
from num2words import num2words
from itertools import islice, product
def ok(n): return "t" not in num2words(n)
def agen(): # generator of terms < 10**304
base, pows = [k for k in range(1, 1000) if ok(k)], [1]
yield from ([0] if ok(0) else []) + base
for e in range(3, 304, 3):
if "u" not in num2words(10**e)[4:]:
pows = [10**e] + pows
for t in product([0] + base, repeat=len(pows)):
if t[0] == 0: continue
yield sum(t[i]*pows[i] for i in range(len(t)))
print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 19 2022
CROSSREFS
KEYWORD
nonn,word
AUTHOR
EXTENSIONS
a(57)-a(60) from WG Zeist, Aug 31 2012
STATUS
approved