%I #17 Mar 18 2022 13:08:26
%S 1,6,14,20,28,32,36,40,43,47,51,58,62,66,77,81,87,94,97,104,107,117,
%T 125,132,139,145,152,159,173,179,188,196,204,211,218,226,234,241,249,
%U 257,277,298,319,323,339,343,349,365,369,392,396,402,421,427,446,472
%N T is the first, sixth, fourteenth, etc. character in this sentence. (In this version, letters, spaces, commas and hyphens all count.)
%H Michael S. Branicky, <a href="/A123267/b123267.txt">Table of n, a(n) for n = 1..10000</a>
%e 0123456789
%e 0 T is the
%e 1 first, six
%e 2 th, fourte
%e 3 enth, twen
%e 4 tieth, twe
%e 5 nty-eighth
%e 6 , thirty-s
%e 7 econd, thi
%e 8 rty-sixth,
%e 9 fortieth,
%e 0 forty-thi
%e 1 rd, forty-
%o (Python)
%o from num2words import num2words
%o from itertools import islice
%o def n2w(n): return num2words(n, ordinal=True).replace(" and", "")
%o def agen(): # generator of terms
%o s, idx = "t is the ", 0
%o while True:
%o idx = 1 + s.index("t", idx)
%o yield idx
%o s += n2w(idx) + ", "
%o print(list(islice(agen(), 56))) # _Michael S. Branicky_, Mar 18 2022
%Y Cf. A005224.
%K nonn,word
%O 1,2
%A _J. Lowell_, Oct 09 2006
%E a(7)-a(22) from _R. J. Mathar_, Nov 10 2006
%E a(23) and beyond from _Michael S. Branicky_, Mar 18 2022
|