OFFSET
1,2
COMMENTS
Dan Hoey came up with an inequality Spell_Length(n)<=A*n+B (I've forgotten A and B, which are fairly small rationals: equality at two points), that was used to limit the maximum length of a self-enumerating sentence, and thus make an exhaustive search possible. - R. H. Hardin, Feb 22 2012
REFERENCES
Eric Angelini, Posting to Sequence Fans Mailing List, Feb 12 2012
Hans Havermann, Posting to Sequence Fans Mailing List, Feb 23 2012
LINKS
Hans Havermann, Table of n, a(n) for n = 1..10000
EXAMPLE
11 = eleven (6 letters) = one one (6 letters)
1002 = one thousand two (14 letters) = one zero zero two (14 letters).
PROG
(Python)
from num2words import num2words as n2w
m = {"0":4, "1":3, "2":3, "3":5, "4":4, "5":4, "6":3, "7":5, "8":5, "9":4}
def dl(n): return sum(m[d] for d in str(n))
def wl(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha())
def ok(n): return dl(n) == wl(n)
print([k for k in range(1, 7000) if ok(k)]) # Michael S. Branicky, Apr 03 2023
CROSSREFS
KEYWORD
nonn,base,word
AUTHOR
N. J. A. Sloane, Jun 01 2012
STATUS
approved