OFFSET
1,2
COMMENTS
"a(n) makes the sequence extendable" means the name of a(n) does not start with any of the letters f and s.
EXAMPLE
38 is followed by 88 as 48, 58, 68 and 78 cannot make the sequence extendable.
MATHEMATICA
names = StringReplace[
IntegerName /@ Range[1000], {"\[Hyphen]" -> "", " " -> ""}];
lst = {1}; next[n_] := next[n] =
Module[{pos = Last[lst] + 1},
While[
Or[
And[First[Characters[names[[Last[lst]]]]] !=
Last[Characters[names[[pos]]]], pos <= Length[names]],
MemberQ[{"f", "s"}, First[Characters[names[[pos]]]]] == True
],
pos++
];
AppendTo[lst, pos]
];
seq[n_] := Nest[next, 1, n]; seq[57]
KEYWORD
easy,nonn,word
AUTHOR
Ivan N. Ianakiev, Feb 20 2017
STATUS
approved