OFFSET
1,2
EXAMPLE
The sentence begins:
1234567890 1234567890 1234567890 1234567890 1234567890
Iisthefirs tsecondeig hthninetee nthtwentyf ifthfortyf
irstfiftyf irstfiftys ixthsixtyf irstsixtys ixthsevent
yfirstseve ntysixthei ghtyfirste ightysixth ninetyfirs
tonehundre dthirdoneh undredfift eenthonehu ndredtwent
iethonehun dredtwenty sixthonehu ndredthirt yfirstoneh
undredthir tyseventho nehundredf ortysecond onehundred ...
MATHEMATICA
seed="iisthe"; s[1]=1; s[2]=2; name[n_]:=
StringReplace[IntegerName[n, {"English", "Ordinal"}], {"-"->"", " "->""}];
s[n_]:=seed=StringJoin[seed<>name[StringPosition[seed, "i"][[n-2, 1]]]];
l=s/@Range[56]; Table[StringPosition[Last[l], "i"][[k, 1]], {k, 1, Length[l]}]
(* Ivan N. Ianakiev, Apr 02 2022 *)
PROG
(Python)
from num2words import num2words
from itertools import islice
def n2w(n):
os = num2words(n, ordinal=True).replace(" and", "")
return os.replace(" ", "").replace("-", "").replace(", ", "")
def agen(): # generator of terms
s, idx = "iisthe", 0
while True:
idx_rel = 1 + s.index("i")
idx += idx_rel
yield idx
s = s[idx_rel:] + n2w(idx)
print(list(islice(agen(), 56))) # Michael S. Branicky, Apr 02 2022
CROSSREFS
KEYWORD
nonn,word,easy,nice
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v, Jul 18 2000
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Nov 02 2000
STATUS
approved