text:
Uncollapse digits
Task
Given a string of English names of digits “collapsed” together, like this:
zeronineoneoneeighttwoseventhreesixfourtwofive

Split the string back into digits:
zero nine one one eight two seven three six four two five

Rules

The input is always a string. It always consists of one or more lowercase English digit names, collapsed together, and nothing else.

The English digit names are zero one two three four five six seven eight nine.

The output may be a list of strings, or a new string where the digits are delimited by non-alphabetic, non-empty strings. (Your output may also optionally have such strings at the beginning or end, and the delimiters need not be consistent. So even something like {{ zero0one$$two ); is a valid (if absurd) answer for zeroonetwo.)
The shortest answer in bytes wins.

Test cases
three -> three
eightsix -> eight six
fivefourseven -> five four seven
ninethreesixthree -> nine three six three
foursixeighttwofive -> four six eight two five
fivethreefivesixthreenineonesevenoneeight -> five three five six three nine one seven one eight
threesevensevensixninenineninefiveeighttwofiveeightsixthreeeight -> three seven seven six nine nine nine five eight two five eight six three eight
zeroonetwothreefourfivesixseveneightnine -> zero one two three four five six seven eight nine

This is an excellent challenge! The task is extremely easy to understand and verify, but the right approach to use isn't very obvious. And choosing the right approach could make a huge difference in score. +1 :)

After thinking this up, I remembered a similar, but more simplistic challenge on anarchy golf: yesno! It sparked some amazing C answers. I hope to see one of those soon :)

I do not think my C answer qualifies as such, but hopefully it's a starting point for others with a more twisted sense of humor than myself.

I'm pretty sure I've seen this same challenge, but where you're supposed to print the actual number. I'm almost certain it was also posted by, you, Lynn; but I've lost the link, hook me up with it?

That wouldn’t have been mine, sorry. Do you mean the challenge was to turn one two three into one hundred and twenty-three?

Can the result be a List of Match objects? (Which saves stringifying the result)

@BradGilbertb2gills What’s the string representation of such a list in your language?

If you turn a List of Matches into a Str, it will space separate the strings. code('eightsix').Str ⇒ 'eight six'

@BradGilbertb2gills I’d say leave the .Str in, then.

@MichaelDorgan (or any other C coders), you may want to have a look at the algorithm I used in my Befunge answer. A straight conversion of that to C got me a 104 byte solution, which I think beats all of the existing C answers. I'm willing to bet that could be improved upon by someone with more C golfing skills.

My straight conversion is around 120 bytes and doesn't handle the \0 char.  You are right though, this will be smaller.

Retina, 20 bytes
!`..[eox]|[tse]?....

Try it online!

C (gcc), 89 80 76 75 72 71 70 69 bytes
f(char*s){*s&&f(s+printf(" %.*s",""[(*s^s[2])%12],s)-1);}

Try it online!
(89) Credit to gastropner for the XOR hash.
(76) Credit to Toby Speight for the idea of using 1st and 3rd.
(75) Credit to Michael Dorgan for '0' → 48.
(72) Credit to Michael Dorgan and Lynn for literals with control characters.
(69) Credit to Lynn for x?y:0 → x&&y
f (char *s) {        /* K&R style implicit return type. s is the input. */
    *s&&f(           /* Recurse while there is input. */
        s+printf(    /* printf returns the number of characters emitted. */
            " %.*s", /* Prefix each digit string with a space. Limit
                      * how many bytes from the string to print out. */
            ""
                     /* Magic hash table, where the value represents
                      * the length of the digit string. The string
                      * is logically equivalent to
                      * "\04\01\05\03\04\05\05\04\04\01\03\03" */
            [(*s^s[2])%12],
                     /* The XOR hash (mod 12) */
            s)       /* The current digit. */
            -1);}    /* Subtract 1 for the space. */

Python 2, 50 bytes
import re
re.compile('..[eox]|[tse]?....').findall

Try it online!
-3 thanks to Lynn.
-4 thanks to Uriel's answer's regex.

Nice! import re;re.compile('…').findall should save a couple of bytes. I did expect this to turn into regex golf :)

@Lynn Hold on, wait until I'm done! :-P EDIT: It's 3 bytes, actually.

@Lynn Also, you should've turned this to [tag:code-golf] [tag:regular-expression] instead. ;)

I’m holding out for a C answer, which will be very interesting!

Befunge, 87 85 81 76 bytes
<*"h"%*:"h"$_02g-v1$,*<v%*93,:_@#`0:~
"@{&ruX;\"00^ !: _>_48^>+:"yp!"*+%02p0

Try it online!
Befunge doesn't have any string manipulation instructions, so what we do is create a kind of hash of the last three characters encountered, as we're processing them.
This hash is essentially a three digit, base-104 number. Every time a new character is read, we mod the hash with 1042 to get rid of the oldest character, multiply it by 104 to make space for the new character, then add the ASCII value of the new character mod 27 (to make sure it doesn't overflow).
For comparison purposes, we take this value mod 3817, write it into memory (thus truncating it to 8 bits), which results in smaller numbers that are easier for Befunge to handle. The hashes we then have to compare against are 0, 38, 59, 64, 88, 92, 114, 117, and 123. If it matches any of those, we know we've encountered a character sequence that marks the end of a number, so we output an additional space and reset the hash to zero.
If you're wondering why base 104, or why mod 3817, those values were carefully chosen so that the hash list we needed to compare against could be represented in as few bytes as possible.

Quite honestly, this looks like bakemoji (ばけもじ) to me.  Wow.  The algorithm description is nice though and I will contemplate it.

^, I remember seeing the term as mojibake (もじばけ). How did you find those numbers (base 104, mod 3187), @JamesHolderness ?

@Zacharý I wrote a little Python script that tested different base and mod combinations to find the ones that would produce the correct results when run against all the expected inputs. Once I knew which combinations worked, I ran the resulting hash outputs through a Befunge number generator to find out which produced the shortest code.

C (gcc), 179 159 146 139 137 116 107 103 102 bytes
Edit 1:
(Added suggestions from Mr. Xcoder - thanks! - My macro version was same size as yours, but I like yours better.)
Edit 2:
Changed char individual compares to calls to strchr()
Edit 3:
K&R's the var declarations (Eww!)
Edit 4:
When 1 macro is not enough...
Edit 5:
Redone with new algorithm suggested above.  Thanks to James Holderness for this great idea!
Edit 6:
Removed 0 set as it seems to go there automatically - Master level code golf techniques used (commas, printf trick, etc.) - thanks gastropner!
Edit 7:
Use memchr and fixed a bug pointed out by James Holderness.
Edit 7:
Use && on final check to replace ? - thanks jxh.
c,h;f(char*s){while(c=*s++)putchar(c),h=h%10816*104+c%27,memchr("&;@X\\ru{",h%3817,9)&&putchar(h=32);}

Try it online!
Non-golfed (Which is still very golfy honestly...)

int c;
int h;
void f(char*s)
{
    while(c=*s++)
        putchar(c),
        h=h%10816*104+c%27,
        memchr("&;@X\\ru{",h%3817,9)?putchar(h=32):1;
}

Old, straight forward grep-esqe solution:
#define p putchar
#define q c=*s++
c,x;f(char*s){while(q){p(c);x=strchr("tse",c);p(q);p(q);if(!strchr("eox",c)){p(q);if(x)p(q);}p(' ');}}

Old, cleaner version.
// Above code makes a macro of putchar() call.

void f(char *s)
{
    char c;
    while(c = *s++)
    {
        putchar(c);
        int x = strchr("tse", c);

        putchar(*s++);
        putchar(c=*s++);

        if(!strchr("eox", c))
        {
            putchar(*s++);
            if(x)
            {
                putchar(*s++);
            }
        }
        putchar(' ');
    }
}

Try it online!

We can macro the putchar and such for a few bytes, but in general, still thinking about a better algorithm if possible.

159 bytes by #defineing putchar and removing a pair of unnecessary brackets.

A bit ugly, but 136 bytes by using #define p putchar( instead (note the open parenthesis).

109 bytes c,h=0;f(char*s){while(c=*s++)putchar(c),h=h%10816*104+c%27,c=h%3817,printf(" "+!(c&&strchr("&;@X\\ru{",c)));}

Ah, the printf trick I saw below plus removal of a couple parenthesis and braces.  Master level code golf enabled :)

Changing the hash to one that doesn't give \ or \0 as values would save another 3 or 4 bytes too due to removal of 0 check and escape, at cost of up to 2 more chars to check against.

This is why I had thought of changing the hash - to get rid of that assignment and extra check.  I'll make another go of it shortly.

Lynn showed me: x?y:0 → x&&y. Even though you evaluate to 1, you are just throwing it away, so you can save a byte.

Thanks.   Mine doesn't touch the xor version above, but I'll take it.

@MichaelDorgan: Well, you helped quite a bit with it.

:)  Kinda fun to see that list of numbers shrink over time.  Addictive even.  Still, you get the crown for the superior algorithm.

95 bytes

Java (OpenJDK 8), 55 46 43 bytes
Saving 9 bytes thanks to Forty3/FrownyFrog
Saving 3 bytes thanks to Titus

s->s.replaceAll("one|tw|th|f|z|s|.i"," $0")

Try it online!
edit: Thank you for the welcome and explanation of lambdas!

Hi, welcome to PPCG! Great first answer, and it indeed works. Here is the TIO link for it. Lambdas can be created in multiple ways. Here is another TIO with some lambdas with added comments so you can see how to create them yourself. (I suggest copying it to Eclipse so you can see the highlighting of the code.) Also, Tips for golfing in Java and Tips for golfing in all languages might be interesting to read. Enjoy your stay! :)

@KevinCruijssen thank you! I am honestly suprised that Java is shorter than JavaScript. Usually when I am reading challenges, JS is a lot shorter.

JavaScript should be 2 bytes shorter (g regex suffix instead of All).

@Neil it is longer here because it is using f=(s)=> instead of s->, which is 4 bytes shorter.

@LucaH - per FrownyFrog's suggestion, you can reduce a few of your two-letter strings to single characters: z|f|s instead of ze|fo|fi|si|se/

@Forty3 thanks for the advice, good call. I wanted to have everything unique, but it simply has not to be occuring anywhere else.

on|t[wh]|.i|[fsz] (-4 bytes)

@Titus on won't work because it will trigger on "zeronine". t[wh] does not save any bytes, but .i does, so I used it. Thank you for that.

Retina, 24 23 bytes
!`..[eox]|[fnz]...|.{5}

Try it online! Edit: Saved 1 byte thanks to @FrownyFrog.

would ..... -> .{5} work?

JavaScript, 66 57 52 44 41 bytes
s=>s.replace(/one|t[wh]|.i|[fsz]/g," $&")
Pretty naive, but it works.
Nice catch by FrownyFrog to use 2 chars .. except for "one" which a pure 2 char check might mess up zeronine. Edit: the single f and s were good catches by FrownyFrog that I overlooked my first two golfs.
Thanks, Neil, for the suggestion of an unnamed lambda and being able to use a single char for z gets down to 52.
Titus comes up with a smaller RegEx. I feel we are heading toward Uriel's regex eventually.

Does it break if you use two characters and push 'on' to the end?

I'm thinking z|tw|th|f|s|ei|ni|on

@FrownyFrog will fail for "twonine" ("on" in middle)

@Uriel so 'ni' doesn't take priority if you put it on the left of 'on'?

@FrownyFrog o comes first so it is recognized first.

@Uriel I see, thanks.

The f=() around the s is unnecessary (unnamed lambda is acceptable).

on|t[wh]|.i|[fsz] (-4 bytes)

@Titus - Unfortunately, the on| will match zeronine rendering zer onine

s=>s.replace(/zero|one|two|three|four|five|six|seven|eight|nine/g, "$& ") this is naive, but straightforward.

Try s=>s.replace(/..[eox]|[est]?.{4}/g,"$& ") instead, still 41 B though

C, 103 99 bytes
char*r="f.tzuonresn.xgv";f(char*s){*s&&f(s+printf("%.*s ",(strrchr(r,s[2])-strchr(r,*s))%10,s)-1);}

This works for any character encoding (including awkward ones like EBCDIC), because it doesn't use the numeric value of the input characters.  Instead, it locates the first and third letters in a magic string.  The distance between these indicates how many letters to advance with each print.
Test program
#include <stdio.h>
int main(int argc, char **argv)
{
    for (int i = 1;  i < argc;  ++i) {
        f(argv[i]);
        puts("");
    }
}

Some bytes can be saved by using recursion: https://tio.run/##XY/LbsMgEEX3@QpElAhc20q6ddsfqbqI8GCQUogAO1aifLs7jGvJMhKPedxzB1V1Sk1769S1b4F9xNRaX5uv3ToVrOswNylzCUX45LpOj967ANHVYzfwRgsqRfks4vGoRXy7oSZpwQ91ERkvBUKCMkGEMn6//8gK4zlEkTycT2WU1Vk2r@n3Yp2Qz92@BW0dMIRJ1nq6y1ufouBcNuxu7BXESe4YLvRJJgBgYYnBdiZFO65S2g6gfR8iDOBWeYc2JMf2LYb67Ui0dPcZsSGSIj8WdcZ5B@SCN0lXmtkpF@fDjlmw7Axamy3fINUW9YDg0QFb5yFw1v9BCE3tGZolr@kP

93 bytes

J, 37 35 bytes
rplc'twthsiseeinionzef'(;LF&,)\~_2:

Try it online!

Cool alternative solution!
I tried f=:[:>'..[eox]|[tse]?....'&rxall and it worked in interpeter, but doesn't work in TIO.

this is really clever, well done

@GalenIvanov TIO has the latest release, it could be a regression in J.

C (gcc), 106 bytes 104 102 bytes
-2 bytes thanks to @jxh
-2 bytes thanks to ceilingcat
c;f(char*s){for(char*t=" $&=B*,29/?";*s;)for(c=4+(index(t,(*s^s[1])+35)-t)/4;c--;)putchar(c?*s++:32);}

Try it online!
XOR is truly our greatest ally.

Like the s++ trick.  Nice hash.

s[1] will be shorter.

@jxh Nice one! Updated.

Z80 Assembly, 46 45 bytes
; HL is the address of a zero-terminated input string
; DE is the address of the output buffer

Match5: ldi                                 ; copy remaining characters
Match4: ldi
Match3: ld a,32 : ld (de),a : inc de        ; and add space after a matched word.

Uncollapse:

        ld a,(hl) : ldi : or a : ret z      ; copy first byte (finish if it was zero)
        ex af,af'                           ; and save its value for later.

        ldi : ld a,(hl) : ldi               ; copy second and third bytes

        cp 'e' : jr z,Match3                ; is the third letter 'e' or 'o' or 'x'?
        cp 'o' : jr z,Match3
        cp 'x' : jr z,Match3

        ex af,af'                           ; now look at the first letter

        cp 'e' : jr z,Match5                ; is it 't' or 's' or 'e'?
        sub 's' : jr z,Match5
        dec a : jr z,Match5
        jr Match4

(It was fun to adapt the Uriel's cool regex to a regex-unfriendly environment).

Jelly,  23  21 bytes
ḣ3OP%953%7%3+3ɓḣṄȧṫḊÇ

A full program printing line-feed separated output. Note: once it's done it repeatedly prints empty lines "forever" (until a huge recursion limit or a seg-fault)
Try it online! (TIO output is accumulated, a local implementation will print line by line)
How?
Starting with a list of characters, the program repeatedly:

finds the length of the first word of the list of characters using some ordinal mathematics;
prints the word plus a linefeed; and
removes the word from the head of the list of characters

The length of the first word is decided by inspecting the first three characters of the current list of characters (necessarily part of the first word). The program converts these to ordinals, multiplies them together, modulos the result by 953, modulos that by seven, modulos that by three and adds three:
word   head3  ordinals       product  %953  %7  %3  +3 (=len(word))
zero   zer    [122,101,114]  1404708   939   1   1   4
two    two    [111,110,101]  1233210    28   0   0   3
one    one    [116,119,111]  1532244   773   3   0   3
three  thr    [116,104,114]  1375296   117   5   2   5
four   fou    [102,111,117]  1324674     4   4   1   4
five   fiv    [102,105,118]  1263780   102   4   1   4
six    six    [115,105,120]  1449000   440   6   0   3
seven  sev    [115,101,118]  1370570   156   2   2   5
eight  eig    [101,105,103]  1092315   177   2   2   5
nine   nin    [110,105,110]  1270500   151   4   1   4

ḣ3OP%953%7%3+3ɓḣṄȧṫḊÇ - Main link, list of characters           e.g. "fiveeight..."
ḣ3              - head to index three                                "fiv"
  O             - ordinals                                           [102,105,118]
   P            - product                                            1263780
    %953        - modulo by 953                                      102
        %7      - modulo by seven                                    4
          %3    - modulo by three                                    1
            +3  - add three                                          4

              ɓ - dyadic chain separation swapping arguments...
... ḣṄȧṫḊÇ ...
    ḣ         - head to index                                        "five"
     Ṅ        - print the result plus a line-feed and yield the result
       ṫ      - tail from index                                      "eeight..."
      ȧ       - and (non-vectorising)                                "eeight..."
        Ḋ     - dequeue                                               "eight..."
         Ç    - call the last link (Main*) as a monad with this as input
              -       * since it's the only link and link indexing is modular.

I am not sure whether this is allowed. (Seriously, what do you do when two greatly upvoted meta-answers say the opposite of each other?)

The OP explicitly states "Your output may also optionally have such strings at the beginning or end" and this program actually prints as it goes, so the output is produced prior to any forced termination anyway.

Sure, but I don't think OP considered an infinite end string. And the meta-question is explicitly about the case where the output is printed first.

I think it fulfils the spirit of the requirement (if it, for example, printed infinite empty strings and then the words I might argue it did not)

So, I guess that puts me into Martin's camp of "if it's a program and can justify..." :)

I certainly didn’t have infinite strings in mind when I wrote the question! I’m of two minds about it. It’s a creative bending of the rules, and I don’t wanna be a spoilsport, so I think I’ll allow it. How much more work would it be to make the program terminate?

@Lynn Could Certainly force termination with three bytes

Retina, 28 bytes
t[ewh]|[zfs]|(ni|o)ne|ei
 $&

Try it online!

Pyth, 35 27 23 bytes
Saved a lot of bytes by porting Uriel's approach.
:Q"..[eox]|[tse]?...."1

Try it here! Initial approach.

Pip, 27 bytes
aR`[zfs]|one|[ent][iwh]`s._

Takes input as a command-line argument. Try it online!
Simple regex replacement, inserts a space before each match of [zfs]|one|[ent][iwh].

Jumping on the bandwagon of stealing borrowing Uriel's regex gives 23 bytes (with -s flag):
a@`..[eox]|[tse]?....`

You can use a shorter regex.

C 168 ,145,144,141 bytes
EDIT: Tried init 'i' to 1 like so

a,b;main(i)

To get rid of leading whitespace,
but it breaks on input starting with three, seven or eight
141
#define s|a%1000==
a,i;main(b){for(;~scanf("%c",&b);printf(" %c"+!!i,b),a|=b%32<<5*i++)if(i>4|a%100==83 s 138 s 116 s 814 s 662 s 478)a=i=0;}

Try it online
144
a,i;main(b){for(;~(b=getchar());printf(" %c"+!!i,b),a=a*21+b-100,++i)if(i>4|a==204488|a==5062|a==7466|a==23744|a==21106|a==6740|a==95026)a=i=0;}

Try it online
168
i,a;main(b){for(;~scanf("%c",&b);printf(" %c"+!!i,b),a|=b<<8*i++)if(i>4|a==1869768058|a==6647407|a==7305076|a==1920298854|a==1702259046|a==7891315|a==1701734766)a=i=0;}

Try it online!
Ungolfed
i,a;main(b){
for(;~scanf("%c",&b); // for every char of input
printf(" %c"+!!i,b), // print whitespace if i==0 , + char
a|=b<<8*i++ // add char to a for test
)
if(
i>4| // three seven eight
a==1869768058|      // zero
a==6647407|        // one
a==7305076|       // two
a==1920298854|   //four
a==1702259046|  //five
a==7891315|    //six
a==1701734766 //nine
) a=i=0; //reset i and a
}

int constants gets unnecessary large by shifting a<<8
but in case you can compare to strings somehow it should be the most natural
146 Using string comparison
#define s|a==*(int*)
a,b;main(i){for(;~(b=getchar());printf(" %c"+!!i,b),a|=b<<8*i++)if(i>4 s"zero"s"one"s"two"s"four"s"five"s"six"s"nine")a=i=0;}

Using String comparison
Obfuscated
#define F(x)if(scanf(#x+B,&A)>0){printf(#x,&A);continue;}
B;A;main(i){for(;i;){B=1;F(\40e%4s)F(\40th%3s)F(\40se%3s)F(\40o%2s)B=2;F(\40tw%1s)F(\40si%1s)B=1;F(\40%4s)i=0;}}

136 bytes

Python 3, no regex,  83 68 65  63 bytes
-15 thanks to Lynn (refactor into a single function)
-3 more thanks to Lynn (avoid indexing into a list with more arithmetic)
...leading to another save of 2 bytes (avoiding parenthesis with negative modulos) :)
def f(s):h=ord(s[0])*ord(s[1])%83%-7%-3+5;print(s[:h]);f(s[h:])

A function which prints the words separated by newlines and then raises an IndexError.
Try it online! (suppresses the exceptions to allow multiple runs within the test-suite)

I'm revisiting this a lot later and realizing this could be 68 bytes: def f(s):h=[4,5,3][ord(s[0])*ord(s[1])%83%7%3];print(s[:h]);f(s[h:])

Oh wow, h(s) and h(s) how did I not notice?! Thanks Lynn!

I'm not sure how I keep coming back to this question and noticing new things, but h=(ord(s[0])*ord(s[1])%83%7+1)%3+3 is 65 bytes! :)

Heh, thanks Lynn, that allowed two more bytes to be golfed off too!

Jelly, 44 bytes
Ṛ¹Ƥz⁶ZUwÐ€“¢¤Ƙƒ⁺6j¹;Ċ-ḶṃżṃgɼṘƑUẏ{»Ḳ¤$€Ẏḟ1Ṭœṗ

Try it online!

Sorry man, you've been outgolfed twice.

Quite long one. You are welcome to golf it down.
R, 109 bytes
function(x)for(i in utf8ToInt(x)){F=F+i;cat(intToUtf8(i),if(F%in%c(322,340,346,426,444,448,529,536,545))F=0)}

Try it online!

Any way to use unicode characters instead of digits?

Nice application of intToUtf8! 90 bytes would be possible by using a different approach using regexp: function(x,p=paste,z=p("(",p(c("zero",broman::numbers),collapse="|"),")"))gsub(z,"\\1 ",x)

Haskell, 81 bytes
f[c]=[c]
f(h:t)=[' '|s<-words"z one tw th f s ei ni",and$zipWith(==)s$h:t]++h:f t

Try it online!
Explanation:
f(h:t)=                      h:f t -- recurse over input string
   [' '|s<-               ]++      -- and add a space for each string s
      words"z one tw th f s ei ni" -- from the list ["z","one","tw","th","f","s","ei","ni"]
      ,and$zipWith(==)s$h:t        -- which is a prefix of the current string

Python 3 (no regex), 85 bytes
i=3
while i<len(s):
	if s[i-3:i]in'ineiveroneghtwoureesixven':s=s[:i]+' '+s[i:]
	i+=1

Try it online!

Welcome to PPCG!

It's nice, but a full program must include the code to take input.

So, as a full program 104 bytes. However you can save 4 by using while s[i:] and then you can get that down to 93 bytes by submitting a recursive lambda (functions only need to return the output rather than print it themselves).

Excel, 181 bytes
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"z"," z"),"on"," on"),"tw"," tw"),"th"," th"),"f"," f"),"s"," s"),"ei"," ei"),"ni"," ni")

Places a space in front of: z, on, tw, th, f, s, ei, ni

Jelly, 40 39 bytes
“¢¤Ƙƒ⁺6j¹;Ċ-ḶṃżṃgɼṘƑUẏ{»Ḳe€€@ŒṖẠ€TḢịŒṖK

Try it online!
How it works
“¢¤Ƙƒ⁺6j¹;Ċ-ḶṃżṃgɼṘƑUẏ{»Ḳe€€@ŒṖẠ€TḢịŒṖK
“¢¤Ƙƒ⁺6j¹;Ċ-ḶṃżṃgɼṘƑUẏ{»                 = the compressed string of the digit names
                        Ḳ                = split at spaces
                         e€€@ŒṖ          = check whether each member of each partition of the argument is a digit.
                               Ạ€        = A function that checks whether all values of an array are true, applied to each element.
                                 T       = Finds the index of each truthy element
                                  Ḣ      = Grab the first element, since we have a singleton array
                                    ịŒṖ  = The previous command gives us the index, partition that splits the input into digits. This undoes it and gives us the partition.
                                       K = Join the array of digits with spaces

QuadS, 21 20 bytes
..[eox]|[tse]?....
&

Try it online!
This is a port of my retina answer.

APL (Dyalog Unicode), 25 bytes
'..[eox]|[tse]?....'⎕S'&'

Try it online!

Scala 3, 45 bytes
Use Regular Expression (scala.util.matching.Regex)

Golfed version. Attempt This Online!
"""..[eox]|[tse]?....""".r.findAllIn(_).toSeq

Ungolfed version. Attempt This Online!
import scala.util.matching.Regex

object Main {
  def main(args: Array[String]): Unit = {
    val pattern: Regex = """..[eox]|[tse]?....""".r

    val input = "threesevensevensixninenineninefiveeighttwofiveeightsixthreeeight"
    val matches = pattern.findAllIn(input).toList

    println(matches.mkString(", "))
  }
}

Jelly, 36 bytes
œṣj⁶;$}
W;“€ɗİẒmṫṃ¦¦ạỊɦ⁼Fḷeṭḷa»s2¤ç/

Try it online!
Algorithm:
for x in ['ze', 'ni', 'on', 'tw', 'th', ...]:
    replace x in input by space+x

I bet we can do even better.

Mathematica, 125 bytes
(s=#;While[StringLength@s>2,t=1;a="";While[FreeQ[IntegerName/@0~Range~9,a],a=s~StringTake~t++];Print@a;s=StringDrop[s,t-1]])&

Try it online!
TIO outputs an error message about "CountryData"(???)
I don't know why this happens, but eveything works fine on Mathematica

Perl 6,  42  30 bytes
*.comb(/<{(0..9).Str.uninames.lc.words}>/)

Test it
{m:g/..<[eox]>||<[tse]>?..../}

Test it
(Translated from other answers)

q/kdb+, 59 51 bytes
Solution:
{asc[raze x ss/:string`z`one`tw`th`f`s`ei`ni]cut x}

Example:
q){asc[raze x ss/:string`z`one`tw`th`f`s`ei`ni]cut x}"threesevensevensixninenineninefiveeighttwofiveeightsixthreeeight"
"three"
"seven"
"seven"
"six"
"nine"
"nine"
"nine"
"five"
"eight"
"two"
"five"
"eight"
"six"
"three"
"eight"

Explanation:
Quick solution, probably better and more golfable approaches.
{asc[raze x ss/:string`z`one`tw`th`f`s`ei`ni]cut x} / ungolfed solution
{                                                 } / lambda with implicit x as input
                                             cut x  / cut x at indices given by left
 asc[                                       ]       / sort ascending
                string`z`one`tw`th`f`s`ei`ni        / string list ("z","one",...)
          x ss/:                                    / string-search left with each right
     raze                                           / reduce down list

Notes:
46 bytes with some simple golfing, replacing q calls with k ones, but still a hefty solution.
asc[(,/)x ss/:($)`z`one`tw`th`f`s`ei`ni]cut x:

Matlab, 432 bytes
A long attempt.
s=char(input('','s'));o=[];while length(s)>0;switch s(1:2);case'ze';o=[o,' ',s(1:4)];s(1:4)=[];case'on';o=[o,' ',s(1:3)];s(1:3)=[];case'tw';o=[o,' ',s(1:3)];s(1:3)=[];case 'th';o=[o,' ',s(1:5)];s(1:5)=[];case'fo';o=[o,' ',s(1:4)];s(1:4)=[];case'fi';o=[o,' ',s(1:4)];s(1:4)=[];case 'si';o=[o,' ',s(1:3)];s(1:3)=[];case'se';o=[o,' ',s(1:5)];s(1:5)=[];case 'ei';o=[o,' ',s(1:5)];s(1:5)=[];otherwise;o=[o,' ',s(1:4)];s(1:4)=[];end;end;o

ungolfed:
s=char(input('','s'))
o=[]
while length(s)>0
switch s(1:2)
    case 'ze'
        o=[o,' ',s(1:4)]
        s(1:4)=[]
    case 'on'
        o=[o,' ',s(1:3)]
        s(1:3)=[]
    case 'tw'
        o=[o,' ',s(1:3)]
        s(1:3)=[]
    case 'th'
        o=[o,' ',s(1:5)]
        s(1:5)=[]
    case 'fo'
        o=[o,' ',s(1:4)]
        s(1:4)=[]
    case 'fi'
        o=[o,' ',s(1:4)]
        s(1:4)=[]
    case 'si'
        o=[o,' ',s(1:3)]
        s(1:3)=[]
    case 'se'
        o=[o,' ',s(1:5)]
        s(1:5)=[]
    case 'ei'
        o=[o,' ',s(1:5)]
        s(1:5)=[]
    otherwise
        o=[o,' ',s(1:4)]
        s(1:4)=[]
end
end
o

Welcome to PPCG!

Thanks! First golf attempt, so not that great. But, I didn't see any other Matlab!

Deorst, 22 bytes
'..[eox]|[tse]?....'gf

Try it online!
Of course, this uses the regex found by Uriel. Although, it’s great when Deorst beats Pyth and Jelly :P

Sorry not any more.

GNU sed, 35 bytes
(including +1 for the -r flag)
s/([ots]|[zfn].|(se|th|ei).)../ &/g

Just a simple regexp replacement.

Ruby, 33 bytes
->s{s.scan(/..[eox]|[tse]?..../)}

Try it online!
(Everybody else is doing it, so why can't we?)

Perl5, 26 bytes
echo zeronineoneoneeighttwoseventhreesixfourtwofive \
| perl -ple 's/..[eox]|[tse]?..../$& /g'

Or just the program:
s/..[eox]|[tse]?..../$& /g

Ruby, 77 bytes
puts gets.gsub(/(one|two|three|four|five|six|seven|eight|nine)/,' \1 ').strip

Try it online!

Swift 5.9, 76 bytes
let f={($0+"").replacing(#/one|t[wh]|.i|[fsz]/#){" "+$0.output}.dropFirst()}


text:
Iterative Alliterative Additive Array Antics
I honestly don't know what the point of this sort of calculation would be, but it should make fun golfing. Shortest code wins.
Input (in no particular order)

An array of integers, a (All elements will be integers less than the length of the array.)
An index therein, i
An iteration count, n

Processing

Store a number x with initial value of 0.
Do the following steps n times:

Add the current value of i to x.
Decrement a[i].
If a[i] is negative, increment it by the length of a.
Set i to a[i].

After the iterations, add the final value of i to x.

Output
After doing the above process, your program should output the final value of x.
Example (n=5)
a                     i   x
2,0,0,5,5,6,7,5,8,5   0   0
1,0,0,5,5,6,7,5,8,5   1   0
1,9,0,5,5,6,7,5,8,5   9   1
1,9,0,5,5,6,7,5,8,4   4   10
1,9,0,5,4,6,7,5,8,4   4   14
1,9,0,5,3,6,7,5,8,4   3   18

The program outputs 21.
Test Case Generator

function newTestCase() {
    var a = Array(Math.floor(Math.random() * 50) + 25).fill(0);
    a = a.map(Math.random).map(e => e * a.length).map(Math.floor);
    var i = Math.floor(Math.random() * a.length);
    for (var x = 0, n = 0, aa = [...a], ii = i; Math.random() * a.length >= .5;) {
        n++;
        x += ii;
        aa[ii]--;
        if (aa[ii] < 0) aa[ii] += a.length;
        ii = aa[ii];
    }
    return {a, i, n, shouldOutput: x + ii};
}
<button type="button" onclick="console.log(newTestCase());">Generate</button>

Ruby, 54 53 bytes
->a,i,n{i+(1..n).map{i=a[i]+=a[i]<1?a.size-1:-1}.sum}

Try it online!

Python 2, 71 bytes
def f(a,i,n):x=0;exec"x+=i;a[i]+=len(a)*(a[i]<1)-1;i=a[i];"*n;print x+i

Try it online!

Kotlin, 86 82 bytes
{a,i,n->var x=0;var y=i;(0..n).map{x+=y;a[y]+=if(a[y]<1)a.size-1 else-1;y=a[y]};x}

Try it online!

Ungolfed
{a, i, n ->
    var x=0
    var y=i
    (0..n).map{
        x+=y
        a[y]+=if(a[y]<1) a.size -1 else -1
        y=a[y]
    }
    x
}

R, 95 83 bytes
function(a,i,n){for(j in 1:n){F=i+F-1
i=(a[i]=a[i]-1+(a[i]-1<0)*sum(a|1))+1}
F+i-1}

Try it online!
Takes i as a 1-based index, so it requires some adjustment to account for that.

JavaScript (ES6), 57 56 55 bytes
Saved one byte thanks to @Lynn.
a=>n=>g=(i,x=0)=>n--?g(a[i]-=a[i]?1:1-a.length,x+i):x+i

Takes input in currying syntax in the format f(a)(n)(i).
Test Cases

f=
a=>n=>g=(i,x=0)=>n--?g(a[i]-=a[i]?1:1-a.length,x+i):x+i
;
console.log( /*21*/ f([2,0,0,5,5,6,7,5,8,5])(5)(0) )
console.log( /*2066*/ f([18,26,9,26,58,53,35,28,0,47,44,6,24,11,66,48,63,64,3,19,67,55,59,35,37,22,41,8,51,44,3,58,58,9,31,29,20,63,43,19,53,28,40,70,20,46,3,69,34,63,49,29,42,69,26,49,37,26,41,62,7,3,66,55,27,59,9,2,36,24,61,6,7])(63)(26) )
console.log( /*1182*/ f([58,3,43,19,8,8,50,24,31,10,8,17,23,2,8,19,19,45,9,46,7,4,6,31,33,19,8,18,37,11,57,28,35,20,22,35,42,38,7,2,48,28,5,17,54,35,5,35,29,9,22,39,27,49,62,40,0,48,52,42,40,24,26])(46)(39) )

C, 66 63 bytes
The first argument is the length of the array.
Thanks to Justin Mariner for saving 3 bytes.
f(l,a,i,n,x)int*a;{for(x=i;n--;x+=i=a[i]+=l*!a[i]-1);return x;}

Getting negative after decrement means it is zero before that.
Try it online!

Python 2, 59 bytes
def f(a,i,n):x=i;exec"a[i]=i=~-a[i]%len(a);x+=i;"*n;print x

Try it online!
Similar to XCoder's, but makes use of simultaneous assignment, and python's delightful negative modulus, plus re-ordering some instructions to eliminate the extra addition.

Java, 87 bytes
I went with a recursive method for this
int r(int[]a,int i,int n){return n>0?(i=a[i]>0?--a[i]:(a[i]=a.length-1))+r(a,i,--n):0;}

see IDEone here

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Reconstruct an arithmetic sequence
Given a finite arithmetic sequence of positive integers with some terms removed from the middle, reconstruct the whole sequence.
The task
Consider an arithmetic sequence: a list of positive integers in which the difference between any two successive elements is the same.
2 5 8 11 14 17

Now suppose one or more integers is removed from the sequence, subject to the following constraints:

The integers removed will be consecutive terms of the sequence.
The first and last integers in the sequence will not be removed.
At least three integers will remain in the sequence.

For the above sequence, possible removals include:
2 5 8 14 17  (removed 11)
2 5 17       (removed 8 11 14)
2 14 17      (removed 5 8 11)

Your task: Given one of these partial sequences, reconstruct the original full sequence.
Details
You may assume input is valid (has a solution) and is missing at least one term. All numbers in the sequence will be positive (> 0) integers. The sequence may have a positive or negative difference between terms (i.e. it may be increasing or decreasing). It will not be a constant sequence (e.g. 5 5 5).
Your solution may be a full program or a function. Any of the default input and output methods are acceptable.
Your input and output may be a string (with any reasonable delimiter), a list of strings, or a list of numbers. You may represent the numbers in whatever base is convenient for your language.
Please mention any unusual I/O methods/formats in your submission, so others will be able to test your code more easily.
Test cases
In: 2 5 8 14 17
Out: 2 5 8 11 14 17
In: 2 5 17
Out: 2 5 8 11 14 17
In: 2 14 17
Out: 2 5 8 11 14 17
In: 21 9 6 3
Out: 21 18 15 12 9 6 3
In: 10 9 5
Out: 10 9 8 7 6 5
In: 1 10 91 100
Out: 1 10 19 28 37 46 55 64 73 82 91 100

This is code-golf; the shortest answer in each language wins.

Related

Would've been interesting to have the input in the form 2 5 ... 17

Related

Haskell, 63 bytes
f(a:b:c)|s<-[a,b..last c],all(`elem`s)c=s
f a=r$f$r a
r=reverse

Try it online!
Basically works by trying to build the result from the front and, if that fails, from the back. This uses the fact that the first and last members of the input will always be correct, the fact that deleted members have to be consecutive, and the fact that there will always be at least three items in the input. All I have to do is assume that the second or second-to-last members are accurate and check if it works. Luckily Haskell has really beautiful syntax for creating arithmetic series.
EDIT: thanks to @xnor for pointing out a bug and providing a solution!

Though this is pretty, it seems it doesn't always work: [1,3,4,5] gives [1,3,5].

And I think all(`elem`s)c should fix it with the same byte count.

Brachylog v2, 9 bytes
⊆.s₂ᵇ-ᵐ=∧

Try it online!
This is a function submission. The Brachylog interpreter can be made to evaluate a function as though it were a full program by giving it Z as a command line argument; in this case, the input is specified in the format, e.g., [1, 2, 4] and the output is returned in a similar format, e.g. Z = [1, 2, 3, 4]. (Of course, for a function submission, the input and output aren't in any format at all; they're just lists.)
This actually solves a harder problem than the one the OP asked for: it works out the shortest arithmetic sequence of integers containing the specified values in the specified order, regardless of whether the deletions are consecutive or not. Because it uses brute force, it can be very slow if many values are deleted.
Explanation
The program has three main parts.
⊆ finds a supersequence of the input (i.e. a sequence that has the input as a subsequence). When there's more than one possible output from a Brachylog program, the output chosen is the first output in tiebreak order, and the tiebreak order is determined by the first command in the program that has an opinion on it; in this case, ⊆ specifies an order that favours short outputs over long ones. So the output we'll get will be the shortest supersequence of the input that obeys the restrictions in the rest of the program.
. … ∧ is used to output the value it sees as input (i.e. the supersequence in this case), but also assert that a specific condition holds on it. In other words, we're outputting the shortest supersequence that obeys a specific condition (and ignoring any intermediate results used to see if it obeys the condition).
Finally, we have s₂ᵇ-ᵐ =, i.e. "all the deltas of the sequence are equal", the condition we're applying to the output. (The return value from this is a list of deltas, rather than the supersequence itself, which is why we need the . … ∧ to ensure that the right thing is output.)
Brachylog is held back here by not having any builtins that can handle calculation of deltas, applying an operation to overlapping pairs from a list, or the like. Instead, we have to say what we mean explicitly: s₂ᵇ finds all (ᵇ) substrings (s) of length 2 (₂) (the use of ᵇ is required to keep a link between unknowns in the substrings and in the supersequence; the more commonly used ᶠ would break this link). Then -ᵐ does a subtraction on each of these pairs to produce a delta. It's annoying to have to write out five bytes s₂ᵇ-ᵐ for something that most modern golfing languages have a builtin for, but that's the way that codegolf goes sometimes, I guess.

05AB1E, 9 8 bytes
Ÿs¥¿Äô€н

Try it online!
Explanation

Construct the range [first, ..., last] with a difference of +/-1
Calculate deltas of the input
Get the absolute value of the gcd of the deltas
Split the full range in chunks of that size
Get the first element of each chunk

Saved 1 byte using gcd of deltas instead of min delta, inspired by user202729

Pyth, 11 bytes
%hS.+SQ}hQe

Try it here!
Thanks to Steven H. for saving a byte!
Pyth, 12 bytes
%.aiF.+Q}hQe

Try it here!
How it works

%.aiF.+Q}hQe ~ Full program.

     .+Q     ~ Get the deltas.
   iF        ~ Reduce by GCD.
 .a          ~ Absolute value.
%            ~ Modular. Get every nth element of...
        }    ~ The inclusive numeric range between...
         hQ  ~ The first element, and...
           e ~ The last element.

Presort Q so you can sort and take the first element instead of abs(GCD(Q)) as in %hS.+SQ}hQe for 11 bytes. Test suite

Python 2, 104 97 89 83 71 67 60 bytes
Thanks to Chas Brown for saving 4 bytes.
Thanks to ovs for saving 7 bytes.
Input the list by arguments.
lambda a,b,*c:range(a,c[-1],min(b-a,c[0]-b,key=abs))+[c[-1]]

Try it online!
Explanation:
Since the removed are consecutive, it is enough to check the differences between two pairs of consecutive elements.

You can save 3 bytes by replacing b if b%c else c with [c,b][b%c>0].

@ChasBrown Thanks, though I soon came up with a better approach.

Nice with the key=abs! It seems that hereabouts, people often omit the f= part unless a recursive function is used; so you could save 2 bytes that way.

Also, replace a[-1]-a[-2] with a[2]-a[1] - the logic is the same, and you get another 2 bytes.

60 bytes

@ovs Amazing! I almost forgot that Python has varargs lambdas...

Jelly, 8 bytes
ṂrṀmIg/$

Try it online!
Notes:

Only work on some old version of Jelly. (this commit for example) (where g use fractions.gcd, which have the result sign the same as input sign, instead of math.gcd, which always return positive value).
The TIO link above is Python 3 TIO link, the Python code consists of Jelly source code from the commit I mentioned above, with the exception of everything (3 files) packed into the same file (for TIO to run) and dictionary.py has been reduced to only some lines. Nevertheless dictionary.py is unrelated to this answer, as it does not use compressed string. (the “...» construct)

Explanation:
First, because a continuous segment is deleted and at least 3 elements remains, there are two consecutive numbers in the old list remain, and the deltas will all be multiples of the step. Therefore the gcd of the differences (I, increments) list will be the absolute value of the step.
Fortunately the gcd is signed (see note above)
So the program does:
ṂrṀ

An increasing integer range from the Ṃinimum to the Ṁaximum.
m

Modular, pick every n'th element.
Ig/$

Monadic ($) chain combine I (increments, differences) and g/ (reduce gcd over elements of the list). If the increments are positive then the gcd will be positive and the returning list will be left-to-right (increasing), and vice-versa.

Yay! Beats the 05AB1E answer by 1 byte!

Using gcd instead of min made us tie. Too bad I get a gcd with sign, otherwise I'd be at 7 ;)

JavaScript (ES6), 92 90
Edit 2 bytes saved thx Arnauld
Easy, as it is enough to check the differences between the first two and the last two. But still unbelievably long.
s=>(e=(z=s.pop(a=s[0]))-s.pop(d=s[1]-a),[...Array((z-(a-=d=e*e>d*d?d:e))/d)].map(_=>a+=d))

Less golfed
s=>{
  a =s[0]
  b =s[1]
  z = s.pop()
  y = s.pop()
  d = b-a
  e = z-y
  d = e*e>d*d?d:e
  n = (z-a)/d+1
  return [...Array(n)].map((_,i) => a + i*d)
}

Test

var F=
s=>(e=(z=s.pop(a=s[0]))-s.pop(d=s[1]-a),[...Array((z-(a-=d=e*e>d*d?d:e))/d)].map(_=>a+=d))

var test=`In: 2 5 8 14 17 Out: 2 5 8 11 14 17
In: 2 5 17 Out: 2 5 8 11 14 17
In: 2 14 17 Out: 2 5 8 11 14 17
In: 21 9 6 3 Out: 21 18 15 12 9 6 3
In: 10 9 5 Out: 10 9 8 7 6 5
In: 1 10 91 100 Out: 1 10 19 28 37 46 55 64 73 82 91 100`.split`\n`
.map(r=>r.split`Out`.map(x=>x.match(/\d+/g)))

test.forEach(([i,k])=>{
  var o=F(i.slice(0))
  var ok = o+''==k
  console.log(ok?'OK':'KO',i+' => '+o)
})

a-=d=e*e>d*d?d:e should work and save 2 bytes.

@Arnauld it works indeed thanks

MATL, 13 bytes
1)0GdYkG0)3$:

Try it online!
Explanation:
Consider the example input [2 14 17]:
           # implicit input, STACK: [[2 14 17]]
1)         # push 1, index, STACK: [2]
0G         # push 0, duplicate input, STACK: [2, 0, [2 14 17]]
d          # take differences, STACK: [2, 0, [12, 3]]
Yk         # get value in [12, 3] nearest to 0, STACK: [2, 3]
G0)        # get last element in input, STACK: [2, 3, 17]
3$:        # 3-input :, computes 2:3:17, the range from 2 to 17 by 3
           # STACK: [[2 5 8 11 14 17]], implicit output.

Wolfram Language (Mathematica), 50 bytes
Range[#&@@#,#[[-1]],#&@@Differences@#~SortBy~Abs]&

Try it online!

Does a "list of numbers" include having the numbers as individual arguments? If so, it looks like you could save a good number of bytes.

@numbermaniac I don't think so, since there isn't a builtin that fetches the last input...

Ahh...true. Forgot about that.

You can use {##} and Last@{##} but the best I could get with that was 51 bytes.

Ruby, 65 62 55 54 bytes
->l{a,*,b,c=l;[*a.step(c,[l[1]-a,c-b].min_by(&:abs))]}

Try it online!
-1 byte thanks to Justin Mariner

You can save a byte by removing h, leaving you with a,*,b,c. Try it online!

Japt, 12 10 bytes
ÌõUÎUäa rm

Try it
ÌõUÎUäa rm     :Implicit input of array U
Ì              :Last element
  UÎ           :First element
 õ             :Range [first,last] with step size
    Uä         :  Consecutive pairs of U
      a        :    Reduced by absolute difference
        r      :  Reduce by
         m     :    Minimum

Haskell, 73 69 bytes
f(h:t)=do(#)<-[(-),(+)];[h,h#minimum(abs<$>zipWith(-)t(h:t))..last t]

Try it online!

I found a 63 byte solution but it's pretty different from yours. Should I make a separate post?

@user1472751 I'm not Laikoni, but this site was intended for competition, as well as collaboration. So I would post it.

@user1472751 Nice approach! Please go ahead and post it as your own answer.

J, 49, 47 46 bytes
(0-[:<./2|@-/\]){.@[&]\({.<.{:)+[:i.{:(+*)@-{.

Inspired by Emigna's solution.
How it works:
 (0-[:<./2|@-/\]){.@[&]\({.<.{:)+[:i.{:(+*)@-{. - fork of 3 verbs

                        ({.<.{:)+[:i.{:(+*)@-{. - generates a list in the entire range of values
                                     {:     -{. - last minus first element
                                       (+*)@    - adds the signum of the difference
                                 [:i.           - makes a list
                       ({.<.{:)                 - the smallest of first and last elements
                               +                - adds the offset to the list (translates all elements according to the first one)

 (0-[:<./2|@-/\])                               - finds the step
         2|@-/\]                                - the absolute differences between all consecutive elements
    [:<./                                       - the smallest one
  0-                                            - negate (for splitting)

                 {.@[&]\                        - splits the list from the right verb into left verb's result sublists and takes their first elements

Try it online!

Husk, 9 bytes
m←C▼Ẋ≠⁰…⁰

Try it online!
Thanks a lot to H.PWiz for halving the byte count, by pointing that applying … on a list rangifies it!...

@HP.Wiz X_X I didn’t know Husk does list ranges like that... Are you sure you don’t want to post it as your own separate answer?

@HP.Wiz Thanks a loooot!

Also, can F⌋ be replaced by ▼?

@H.PWiz @_@ Why does that even work?

The smallest (absolute) difference will be the original difference. The only reason for gcd was to deal with negative deltas

@H.PWiz Oh yeah sorry I forgot I updated the approach

C# (.NET Core), 167+13=180 145+13=158 bytes
a=>{int x=a[1]-a[0],y=a[2]-a[1],d=x*x<y*y?x:y,s=Math.Abs((a[a.Length-1]-a[0])/d),i=0,j=a[0];var r=new int[s+1];for(;i<=s;j+=d)r[i++]=j;return r;}

Try it online!
+13 for using System;
Surprisingly, this challenge had more nuance that I initially anticipated.
Acknowledgements
-22 bytes saved due to some neat simplifications from @DLosc.
DeGolfed
a=>{
    int x = a[1]-a[0],        // difference between first and second numbers
        y = a[2]-a[1],        // difference between second to last and last numbers
        d = x*x < y*y? x : y, // smallest absolute value difference
        s = Math.Abs((a[a.Length-1] - a[0]) / d), // number of steps in the reconstructed sequence (not the number of elements)
        i = 0,                // step position
        j = a[0];             // next number in reconstructed sequence

    var r = new int[s+1];

    // reconstruct the sequence
    for(; i <= s; j+=d)
        r[i++]=j;

    return r;
}

R, 62 bytes
function(x)seq(x[1],tail(x,1),min(abs(d<-diff(x)))*sign(d[1]))

Try it online!

Python 2, 147 bytes
from fractions import*
a=input()
b=[j-i for i,j in zip(a[:-1],a[1:])]
l=min(gcd(i,j)for i in b for j in b)
print list(range(a[0],a[-1]+l/abs(l),l))

Try it online!

Python 2, 78 bytes
lambda a:range(a[0],a[-1],[min,max][a[0]>a[1]](a[1]-a[0],a[-1]-a[-2]))+[a[-1]]

Try it online!

77 bytes

Jelly, 8 bytes
ṂrṀmILÞṪ

Try it online!

dc, 64 bytes
?dsx[ksE0_1]sg[scdlcr-d2^vdK>gK0=g+sqz1<l]dslx[pdlE+dlx!=Z]dsZxp

Try it online!

Vyxal, 7 bytes
ḣtṡ?¯ġḞ

Try it Online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Thanksgiving Feast
Tomorrow, November 23rd, is Thanksgiving Day in the United States. To prepare, you need to cook up some ASCII turkeys. However, since you're late in planning, you need a program (or function) to help you with how many birds you need to prepare.
      .---.   _
    .'     './ )
   /   _   _/ /\
 =(_____) (__/_/==
===================

The turkeys you found are rather on the small side, so you've figured out the following ratios -- one turkey will feed:

four people who only like white meat and three people who only like dark meat
or seven people who don't care either way
or a combination thereof.

Meaning, there are a total of 4 servings of white meat and 3 servings of dark meat in any given turkey. Further, you can't purchase and cook a partial turkey.
For example, for 3 people who only like white meat, 6 people who only like dark meat, and 3 people who don't care, you'll need two turkeys. That gives 8 servings of white and 6 servings of dark, which is enough to satisfy everyone and have some leftover white meat:
      .---.   _         .---.   _
    .'     './ )      .'     './ )
   /   _   _/ /\     /   _   _/ /\
 =(_____) (__/_/== =(_____) (__/_/==
=====================================

For 20 people who don't care, you'll need three turkeys, and have either a little bit of white or dark leftover:
      .---.   _         .---.   _         .---.   _
    .'     './ )      .'     './ )      .'     './ )
   /   _   _/ /\     /   _   _/ /\     /   _   _/ /\
 =(_____) (__/_/== =(_____) (__/_/== =(_____) (__/_/==
=======================================================

And so on.
Rules

The three inputs can be in any order you choose, and in any convenient format. Please indicate in your answer how the input is taken.
There will never be a requirement for more than 25 turkeys (so a maximum of 175 people to feed).
Leading/trailing newlines or other whitespace are optional, provided that the characters line up appropriately.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Output can be to the console, returned as a list of strings, returned as a single string, etc.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

your ratios don't quite make sense to me - you seem to imply that the 7 people who don't care only get the leftovers, but seem to write that a turkey can feed 3+4+7 = 14 people (or that one turkey might only be enough to feed 3 dark meat eaters).

@dzaima From the examples, it seems that one turkey has 4 servings of white meat and 3 of dark. So it serves (4 people who only like white meat AND 3 people who only like dark meat) OR 7 people with no preference.

@KSmarts that's what I'm saying in my comment too, but the text doesn't say that well

@dzaima KSmarts has it correct. There are 4 servings of white and 3 of dark in any given turkey. I'll make that a bit more clear.

Are all 25 turkeys to be printed in one huge horizontal line?

How should the turkeys be put next to each other? It seems as that none of the current answers have that overlap that the examples do

@dzaima I guess I didn't explicitly specify, so as long as they're turkeys all in a row, that's fine.

@Neil Yes, all one row of turkeys (you have a big table).

Do we get a bounty for a solution in Chicken?

Befunge-93, 231 224 bytes
p&:10p3+4/:&:20p2+3/\-:v
v<0-1:+*`0:-\/7+++&g02<0
>"   _   .---.      "vg`
>"  ) /.'     '.    "v0*
>"  \/ /_   _   /   "v1+
>"==/_/__( )_____(= "v6:
v^0-1 _$"v"000g1+:>v v^<
:#,_$:^1,+55:p+1p00< >>>
_$$99+*"=":>,#:\:#->#1_@

Try it online!
The three values are read from stdin in the order: white meat, dark meat, don't care.

I know I'm not supposed to upvote a code golf challenge for artistically laid out code but... This just happens to look like a freakin turkey in the oven, so +1!

I look at the question and think "There's no way golfed code can do this easily", and then I saw a friggin turkey in the oven getting cooked and solving the problem.

APL (Dyalog), 120 118 104 bytes
14 bytes saved thanks to @Adám
{,/(⌈⌈/4 3 7÷⍨⍵,⍺++/⍵)/⊂'='⍪⍨' .-_''/)\=('[4 19⍴10 10⊤¯35+⎕UCS'###(##-:77-&(#F*####+,&0N&&)#,N0Z&d++#']}

Try it online!
The picky white and dark are on the right, the non picky on the left.
Too bad most of the byte count is taken by the string currently.
How?
⍵,⍺++/⍵ - creates array of whity, darky and sum of them all plus non pickys
4 3 7÷⍨ - divide by how many of them gets their wishes from one chicken
⌈/ - take the highest estimate of the three - so if we have extremely high amount of dark meat seekers, they won't be left aside
⌈ - ceiling, in case only a half-chicken is in demand
Then we create a string, enclose it with ⊂, then repeat the eclosed matrix the calculated chickens times with /, and finally concatenate all chickens with ,/.

+1 for calling the turkeys chickens. Because that's what they are, glorified chickens. Still delicious though.

@J.Sallé Nobody calls me chicken

'='⍪⍨' .-_''/)\=('[4 19⍴10 10⊤¯35+⎕UCS'###(##-:77-&(#F*####+,&0N&&)#,N0Z&d++#'] with ⎕IO←0.

Python 2, 142 bytes
lambda w,d,n:[min(e)+-min(-w/3,-d/4,-(w+d+n)/7)*e.center(18)for e in"  .---.   _"," .'     './ )","/   _   _/ /\\","=(_____) (__/_/==","="*18]

Try it online!
-16 bytes thanks to Lynn
-4 bytes thanks to Mr. Xcoder
and back to a lambda xD

Python 2, 197 189 174 bytes
thanks to Erik the Outgolfer for -12 bytes
thanks to Jonathan Frech for -1 byte
a,b,c=input()
for i in range(5):print'='[i<4:]+(' '+"   =   (  /_ . _ ' _.  _- __-  )-   .  ( '__ ./_ / /_ /_ )\\/   =   ="[i::4],'='*18)[i>3]*max((6+c+a+b)/7,a+3>>2,(b+2)/3)

Try it online!

SOGL V0.12, 65 bytes
N∫4*κ:F3*.-:h+.-¹χ∆>?F"Ωeχ&i[A⁄╔■§‼╗╝│¼ο≠≈⁹,Ρ⁴žγūž℮3zl3βΜ%G‘'³n*←

Try it Here!
Order of inputs is white, dark, and then either.

Kotlin, 207 198 bytes
thanks to Taylor Scott for -7 bytes
{a,b,c->val n=maxOf((a+3)/4,(b+2)/3,(6+c+a+b)/7);arrayOf("      .---.   _   ","    .'     './ )  ","   /   _   _/ /\\  "," =(_____) (__/_/==").map{println(it.repeat(n))};println("=".repeat(n*18+1))}

This does not work on TIO yet, as it requires Kotlin 1.1
Try it online!

Excel VBA, 222 219 211 198 Bytes
Anonymous VBE immediate window function that takes input from range [A1:C1] with order of white meat, dark meat, and indifferent in that order and outputs to the range [D1].
[D1]=[Int(Max((A1+3)/4,(B1+2)/5,Sum(1:1,6)/7))]:For Each s In Split("      .---.   _   1    .'     './ )  1   /   _   _/ /\  1 =(_____) (__/_/==1",1):[E1]=s:?[Rept(E1,D1)]:Next:?[Rept("=",18*D1+1)]

Initially the solution finds the correct number of turkeys and then it repeats the turkey pattern that many times. Ideally this would then be directly outputted onto the VBE immediate window as shown by the function below
[D1]=[Int(Max((A1+3)/4,(B1+2)/5,Sum(1:1,6)/7))]:For Each s In Split("      .---.   _   1    .'     './ )  1   /   _   _/ /\  1 =(_____) (__/_/==1",1):[E1]=s:?[Rept(E1,D1)]:Next:?[Rept("=",18*D1+1)]

This version does initially produce the correct response, however, it is immediately autoformatted by the compiler, as _ is the line continutation character, and is thus moved to have only one  (space) character to its left, breaking the pattern.
Example shown below for clarity
[A1:C1]=Array(0,0,20):[D1].Clear
[D1]=[Int(Max((A1+3)/4,(B1+2)/5,Sum(1:1,6)/7))]:For Each s In Split("      .---.   _   1    .'     './ )  1   /   _   _/ /\  1 =(_____) (__/_/==1",1):[E1]=s:?[Rept(E1,D1)]:Next:?[Rept("=",18*D1+1)]

'' Note that the `_` to the right has moved     V
      .---.   _         .---.   _         .---. _
    .'     './ )      .'     './ )      .'     './ )
   /   _   _/ /\     /   _   _/ /\     /   _   _/ /\
 =(_____) (__/_/== =(_____) (__/_/== =(_____) (__/_/==
=======================================================

To correct this the last space character (, char 32) before the _ in line one of the output is replaced with a non-breaking space ( , char 160, Alt + 255)
      .---.   _         .---.   _         .---.   _
    .'     './ )      .'     './ )      .'     './ )
   /   _   _/ /\     /   _   _/ /\     /   _   _/ /\
 =(_____) (__/_/== =(_____) (__/_/== =(_____) (__/_/==
=======================================================

-3 bytes for use of 1 delimited split statement
-8 bytes for use moving ='s into the split and using string addition over concatenation
-13 bytes for use of a non-breaking space to prevent autoformatting of the output

Charcoal, 76 bytes
”{‴∨➙×95;{；Ｃ.ÞgＦ⁷Ｊ*←λ|⁸ＫＫ][§Ｘ⎚¦»Ｚ◧↘gⅉ✳⟧F⎇≧h”×=¹⁹ＮθＮηＦ⊖⌈⌈⟦∕θ³∕η⁴∕⁺⁺θηＮ⁷⟧Ｃ¹⁸¦⁰

Try it online! Link is to verbose version of code. Explanation:
”{‴∨➙×95;{；Ｃ.ÞgＦ⁷Ｊ*←λ|⁸ＫＫ][§Ｘ⎚¦»Ｚ◧↘gⅉ✳⟧F⎇≧h”

Print a 1-space-indented turkey.
×=¹⁹

Print the table.
ＮθＮη

Input the number of dark and white meat eaters.
Ｆ⊖⌈⌈⟦∕θ³∕η⁴∕⁺⁺θηＮ⁷⟧

Repeat one less than the ceiling of the maximum of a) one third of the number of dark meat eaters b) one quarter of the number of white meat eaters c) one seventh of the number of diners.
Ｃ¹⁸¦⁰

Make a copy of the turkey.

JavaScript (ES6), 180 179 bytes
Outputs an array of strings.
(a,b,c)=>[...`      .---.   _
    .'     './ )
   /   _   _/ /\\
 =(_____) (__/_/==`.split`
`.map(l=>l.repeat(n=Math.max((6+c+a+b)/7,a+3>>4,(b+2)/3)|0)),'='.repeat(18*n+1)]

f=

(a,b,c)=>[...`      .---.   _
    .'     './ )
   /   _   _/ /\\
  =(_____) (__/_/==`.split`
`.map(l=>l.repeat(n=Math.max((6+c+a+b)/7,a+3>>4,(b+2)/3)|0)),'='.repeat(18*n+1)]

console.log(f(3, 2, 3))
console.log(f(0, 0, 20))

JavaScript (ES6), 182 181 bytes
Outputs a single string.
(a,b,c)=>`      .---.   _
    .'     './ )
   /   _   _/ /\\
 =(_____) (__/_/==
${'='.repeat(18)}`.split`
`.map(l=>l.repeat(Math.max((6+c+a+b)/7,a+3>>4,(b+2)/3))).join`
`+'='

f=

(a,b,c)=>`      .---.   _
    .'     './ )
   /   _   _/ /\\
 =(_____) (__/_/==
${'='.repeat(18)}`.split`
`.map(l=>l.repeat(Math.max((6+c+a+b)/7,a+3>>4,(b+2)/3))).join`
`+'='

console.log(f(3, 2, 3))
console.log(f(0, 0, 20))

-1 byte (Arnauld): a+3>>4 instead of (a+3)/4)


text:
Compute the Lambert W function
Your challenge is to compute the Lambert W function. \$W(x)\$ is defined to be the real value(s) \$y\$ such that
$$y = W(x) \text{ if } x = ye^y$$
where \$e = 2.718281828...\$ is Euler's number.
Sometimes, \$y\$ may not be real.
Examples
W(-1) = non-real
W(-0.1) = -0.11183, -3.57715
W(1) = 0.56714
W(2) = 0.85261

Here's a quick graph of what this function looks like.

Rules
Your goal is to take an input and output either nothing, 1 solution, or 2 solutions, out to 5 significant figs. You should expect float inputs within the reasonable range of -100..100.
This is code-golf, so shortest code wins.

A note about Lambert W function: there is no solution for x < -1/e, two solutions for -1/e < x < 0, and one solution for x == -1/e or x >= 0.

5 places after the decimal, or 5 significant figures? Since W^-1(x) tends to negative infinity when x->0-, it is hard to get 5 places after the decimal.

If one input should give two values, this is not a function

@Mr.Xcoder Sure, though the non-real output should be reasonable.

@ColeraSu Fixed.

@LuisMendo It's a multivalued 'function'.

I think a nice way to handle multiple solutions is the output being a list of reals, containing 0, 1, or 2 values. Would this be allowed?

@xnor Sounds like a great idea. Editting.

Octave, 36 34 bytes
@(x)(y=lambertw(-1:0,x))(~imag(y))

Try it online!
I solved this in 10 different ways without the builtin, but I couldn't get the solution for both the -1 branch and the 0-branch. I wasn't able to solve this without resorting to the builtin lambertw function. Even though it uses a builtin, it's far from straightforward.
lambertw will only give out one value by default, namely the W0(x), unless otherwise specified. The problem arises when we specifies that we want two values, both W0(x) and W-1(x). If this is the case, and x>=0, it will return one real and one complex result.
We therefore have to specify that we only want the results where the imaginary part of the result is zero.
Breakdown:
@(x)                              % Anonymous function that takes x as input
    (y=lambertw(-1:0,x))          % The lambertw function, with both the -1 and 0 branches
                        (~imag(y))  % Index, where the elements with imag(y)=0 is true

05AB1E, 98 86 75 74 73 bytes
-11 bytes thanks to @KevinCruijssen
žr(zV"Ðžrsm*I-d"UY‹iõë∞.ΔX.V}®s‚ΔDÅAX.Vǝ}н,0‹i∞.Δ(X.V}(®‚ΔDÅAX.V≠ǝ}IYÊiн,

Try it online!
Explanation:
(I will let f(x)=x*e^x)
žr(zV"Ðžrsm*I-d"U #Let Y=-1/e,X=str(ÐYsm*I-d) to save characters in the future

Y‹iõ              #if input<-1/e: print empty string

ë∞.ΔX.V}          #else: find least int k>=1 such that f(k)>=0 (evaluates string X as though it were a function)

®s‚               #make list [-1,k]

ΔDÅAX.Vǝ}         #find root of f(x)-input in the interval [-1,k] using bisection method

                  #actually this outputs a list with 2 numbers which will be very close to each other, which represents the interval in which the root lies

                  #e.g. the list [-3.00001,-3] would represent the interval [-3.00001,-3]

н,                #print the first item of the list; stack is currently empty

0‹i               #if input<0:

∞.Δ(X.V}(         #find greatest int k<=-1 such that f(k)>=0

®‚                #make list [k,-1]

ΔDÅAX.V≠ǝ}        #find root of f(x)-input in the interval [k,-1] using bisection method

                  #again, this outputs a list rather than a single number

IYÊiн,            #if input!=-1/e, print that root (done so that "-1" is not printed twice)

Visualization of the program's indentation:
žr(zV"Ðžrsm*I-d"UY‹iõë∞.ΔX.V}®s‚ΔDÅAX.Vǝ}н,0‹i∞.Δ(X.V}(®‚ΔDÅAX.V≠ǝ}IYÊiн,
                   {    {   }   {       }    {  {    }   {        }   {

I'm sure this can be golfed some more, but here is 75 bytes by replacing both 1( with ® (relevant 05AB1E tip), and putting ÐYsm*I-d inside a string variable at the start, so we can use it four times with .V.

C, 101 + 2 (-lm) bytes
Returns how many real solutions, and store them in an array.
This one is very slow, since it uses a brute-force approach to find roots. It handles up to x = 9e9.
f(a,b,p,t,c,x)float*b,a,x;{for(p=a<0,c=0,x=-50;x<9;x+=2e-6,p=t)(t=x*exp(x)>a)^p?b[c++]=x:0;return c;}

Try it online!
C, 148 146 + 2 (-lm) bytes
This function returns how many real solutions, and store them in the given pointers.
Use binary search to find a solution. It handles up to about x = 108.
#define h(x)99;for(l=-1;x=(l+r)/2,fabs(l-r)>1e-6;)x*exp(x)>a?r=x:(l=x);
f(a,b,c,l,r)float*b,*c,a,l,r;{r=h(*b)r=-h(*c)return-1/exp(1)>a?0:a<0?2:1;}

Try it online!

Ruby, 131 bytes
->x{y,z,e,l=1,-1,Math::E,->t{Math::log t};100.times{z=x<0&&x>-1/e ?l[x/z]:p;y=x<-1/e ?"non-real":x>e ?l[x/y]:x*e**-y};p y;z&&(p z)}

Try it online!
Basically applies fixed-point iteration 100 times, as partially explained in Lambert W function aproximation.

Why non-competing?

Marking a submission non-competing does not make it valid. If your submission is invalid, please edit it to make it valid or delete it altogether. Relevant meta post.

Actually the only non-competing reason I have seen is language postdate the challenge. In other cases I often see they are deleted or competing. / Well, apply the fixed-point iteration is a valid way to compute the function, but only if you can prove that it is good enough (to your own requirement).

@JungHwanMin My submission is valid, I just marked it non-competing because, well, I didn't want to compete. I suppose that in itself is not a valid reason :P

Casio BASIC, 192 Bytes
A port of My 05AB1E answer
?→X
""
If X≥-e^-1
    Then 0→R
    While Re^R<X
        Isz R
    WhileEnd
    -1→L
    While Re^R>X
        .5(L+R→M
        If Me^M<X
            Then M→L
            Else M→R
        IfEnd
    WhileEnd
    If X<0
        Then M◢
        While Le^L<X
            Dsz L
        WhileEnd
        While Le^L≠X
            .5(L+R→M
            If Me^M<X
                Then M→R
                Else M→L
            IfEnd
        WhileEnd
        If M≠-1
            Then M

Note that indents are actually not supported; I added them for legibility.

Forth (gforth), 144 bytes
: N 99 for fover fover fnegate fexp f* fover 2e f** f+ fswap 1e f+ f/ next f. ;
: f fdup 0e -1e fexp f- f> if 0e N fdup f0< if -2e N then then ;

Try it online!
Being stuck with the floating-point stack hurts a lot (with all the f-prefixes), but I guess it's pretty good score for a non-built-in after all.
Uses 100 iterations of Newton's method described here: given a previous estimate of \$w=W(x)\$, the next estimate \$w'\$ is calculated using the formula
$$
w' = \frac{xe^{-w}+w^2}{w+1}
$$
I simplified the starting points for the golf: starting at 0 for primary branch (if \$x \ge -1/e\$) and -2 (inflection point) for secondary branch (if \$-1/e \le x < 0\$) should suffice theoretically.
: N ( x w -- x )
  99 for                        \ ( x w ) run Newton's method 100 times...
    fover fover fnegate fexp f* \ ( x w x*e^-w )
    fover 2e f** f+             \ ( x w x*e^-w+ww )
    fswap 1e f+ f/              \ ( x (x*e^-w+ww)/(w+1) )
  next
  f.     \ Print the resulting w
;
: f ( x -- )
  fdup 0e -1e fexp f-  \ ( x x -1/e )
  f> if                \ ( x ) if less than -1/e, no solution
    0e N               \ ( x ) print primary solution
    fdup f0< if        \ ( x ) if less than 0, two solutions
      -2e N f.         \ ( x ) print secondary solution
    then
  then
;

Wolfram Language (Mathematica), 28 bytes
x/.NSolve[#==E^x x,x,Reals]&

Try it online!
Returns x for no-solution.
This function should give all solutions because NSolve algorithm uses inverse functions, and there is a built-in inverse function of x = y*(e^y) called ProductLog.
Explanation
#==E^x x

Equation <input> = e^x * x
NSolve[ ... ,x,Reals]

Find solutions in the domain of real numbers.
x/.

Replace x with the solutions.
Alternative version, 35 bytes
N@ProductLog[{-1,0},#]~Cases~_Real&

Try it online!

Python 3, 258 bytes
e,f,X,R,L=2.7182818,lambda x:x*e**x,float(input()),0,-1
if X>=-1/e:
 while f(R)<X:R+=1
 while f(R)>X:
  M=(L+R)/2
  if f(M)<X:L=M
  else:R=M
 print(M)
 if X<0:
  while f(L)<X:L-=1
  while f(L)!=X:
   M=(L+R)/2
   if f(M)<X:R=M
   else:L=M
  if M!=-1:print(M)

Try it online!
A port of my 05AB1E answer

SageMath, 39 bytes
lambda z:[lambert_w(l,z)for l in[0,-1]]

Try it on SageCell!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
"Early bird" squares
Definition
If you take the sequence of positive integer squares, and concatenate them into a string of digits (i.e. 149162536496481100...), an "early bird" square is one that can be found in this string ahead of its natural position.
For example, 72 (the number 49), can be found at an offset of 2 in the string, although the natural position is at offset 10. Thus 7 is the first "early bird" square.
Note that for it to be considered an "early bird" square, all the digits in the square must occur before the start of the natural position. A match that partially overlaps the natural position does not count.
a(n) is the nth positive integer k such that k2 is an "early bird" square.
Task
Given a positive integer n, output a(n).
You can use 1-based or 0-based indexing, but if you use 0-based indexing, please say so in your answer.
You solution should be able to handle at least as high as a(53) (or if you're using 0-based indexing, a(52)).
Testcases
n     a(n)
1     7
2     8
3     21
4     25
5     46
6     97
7     129
8     161
9     196
10    221
...
13    277
...
50    30015
51    35000
52    39250
53    46111

References

OEIS A181585

Is the table of test cases using base 0 or 1?

Can outputting the first n elements of the sequence be accepted? It's up to OP but many people choose to allow that.

@idrougge test cases are 1-based.

@HyperNeutrino I'd prefer to have a consistent set of results for all answers, so please just return the single value of a(n).

Test cases up to 79.

05AB1E, 10 9 bytes
Saved 1 byte thanks to Adnan.
µNL<nJNnå

Try it online!
Explanation
µ           # loop until counter equals the input
 NL         # push the range [1 ... iteration_no]
   <        # decrement each
    n       # square each
     J      # join to string
      Nnå   # is iteration_no in the string?
            # if true, increase counter

You can leave out the ½ as that will be automatically added to the loop when missing.

@Adnan: True. Noticed this challenge just before I jumped on a train (or was going to if it hadn't been delayed), so I totally missed that. Thanks :)

JavaScript (ES6), 51 49 45 bytes
1-indexed.
f=(n,s=k='')=>n?f(n-!!s.match(++k*k),s+k*k):k

Demo

f=(n,s=k='')=>n?f(n-!!s.match(++k*k),s+k*k):k

for(n = 1; n <= 20; n++) {
  console.log('a(' + n + ') = ' + f(n))
}

Formatted and commented
f = (                         // f = recursive function taking:
  n,                          //   n = input
  s = k = ''                  //   s = string of concatenated squares, k = counter
) =>                          //
  n ?                         // if we haven't reached the n-th term yet:
    f(                        //   do a recursive call with:
      n - !!s.match(++k * k), //     n decremented if k² is an early bird square
      s + k * k               //     s updated
    )                         //   end of recursive call
  :                           // else:
    k                         //   return k

Non-recursive version, 53 bytes
This one does not depend on your engine stack size.
n=>{for(k=s='';n-=!!(s+=k*k).match(++k*k););return k}

Try it online!

Pyth, 12 bytes
e.f/jk^R2Z`*

Try it here!
How it works

e.f/jk^R2Z`* ~ Full program. Let Q be our input.

 .f          ~ First Q positive integers with truthy results. Uses the variable Z.
      ^R2Z   ~ Square each integer in the range [0, Z).
    jk       ~ Concatenate into a single string.
   /         ~ Count the occurrences of...
          `* ~ The string representation of Z squared.
               Yields 0 if falsy and ≥ 1 if truthy.
e            ~ Get the last element (Qth truthy integer). Output implicitly.

APL (Dyalog), 53 42 bytes
{{0<+/(⍕×⍨⍵+1)⍷' '~⍨⍕×⍨⍳⍵:⍵+1⋄∇⍵+1}⍣⍵⊢0}

Try it online!
How?
⍷ - find occurrences of
⍕×⍨⍵+1 - stringified square of x+1 in the
⍕×⍨⍳⍵ - stringified range of squares x
' '~⍨ - without spaces
+/ - sum
0< - if the sum is positive (occurrences exist), then it returns x+1, otherwise,
∇⍵+1 - recurse with x+1.
⍣⍵ - apply n times.

Perl 5, 34 bytes
33 bytes code + 1 for -p.
$s.=$\*$\while$_-=$s=~(++$\*$\)}{

Try it online!

Haskell, 73 bytes
import Data.List
([n|n<-[7..],isInfixOf(g n)$g=<<[1..n-1]]!!)
g=show.(^2)

Try it online! Zero-indexed.
Explanation
Auxiliaries:
import Data.List -- import needed for isInfixOf
g=show.(^2)      -- function short cut to square an int and get the string representation

Main function:
(                                 !!) -- Index into the infinite sequence
 [n|n<-[7..],                    ]    -- of all numbers n greater equal 7
      isInfixOf(g n)$                 -- whose square appears in the string
                     g=<<[1..n-1]     -- of all squares from 1 up to n-1 concatenated.

Jelly, 13 11 bytes
R²DµṪẇF
Ç#Ṫ

Try it online!
Alternatively this is a 10 bytes solution that prints n first values of the sequence: Try it online!

lol you beat me to this; I had the exact same as your solution (after golfing) :P

@HyperNeutrino Seems to be wrong, unfortunately.

Oh really? That's unfortunate :( edit oh right the nfind thingy :(((

@HyperNeutrino No problem, reading from stdin works.

Python 2, 62 61 bytes
n=input();i=0;s=''
while n:i+=1;n-=`i*i`in s;s+=`i*i`
print i

Try it online!

Jelly, 11 bytes
Ḷ²DFɓ²ẇ
Ç#Ṫ

Try it online!
An alternative to user202729's solution.
How it works
C#Ṫ ~ Main Link.

Ç#  ~ First N positive integers with truthy results.
  Ṫ ~ Tail. Take the last one.

-----------------------------------------------------------

Ḷ²DFɓ²ẇ ~ Helper link. This is the filtering condition.

Ḷ       ~ Lowered range. Yields {x | x ∊ Z and x ∊ [0, N)}.
 ²      ~ Square each.
  D     ~ Convert each to decimal (this gets the list of digits).
   F    ~ Flatten.
    ɓ   ~ Starts a new monadic chain with swapped arguments.
     ²  ~ N²; Yields N squared.
      ẇ ~ Is ^ sublist of ^^^?

Wow, ẇ has automatic stringification.

Alice, 32 bytes
/
\io/&wd.*\@! d ? ~ ? F $ /WKdt

Try it online!
The wasteful layout of that stretch of Ordinal mode is really bugging me, but everything I try to save some bytes there comes out longer...
Explanation
/
\io/...@...

Just the usual decimal I/O framework, with the o and @ in slightly unusual positions. The meat of the program is this:
&w    Push the current IP address to the return address stack n times.
      This gives us an easy way to write a loop which repeats until we
      explicitly decrement the loop counter n times.

  d     Push the stack depth, which acts as our running iterator through
        the natural numbers.
  .*    Square it.
  \     Switch to Ordinal mode.
  !     Store the square (as a string) on the tape.
  d     Push the concatenation of the entire stack (i.e. of all squares before
        the current one).
  ?~    Retrieve a copy of the current square and put it underneath.
  ?     Retrieve another copy.
  F     Find. If the current square is a substring of the previous squares,
        this results in the current square. Otherwise, this gives an empty
        string.
  $     If the previous string was empty (not an early bird) skip the next
        command.
  /     Switch back to Cardinal. This is NOT a command.
  W     Discard one address from the return address stack, decrementing our
        main loop counter if we've encountered an early bird.
K     Jump back to the beginning of the loop if any copies of the return
      address are left. Otherwise do nothing and exit the loop.

dt    Push the stack depth and decrement it, to get the final result.

I don’t know this language, but could you save any bytes by checking whether the current square is in the string before appending it?

@WGroleau I don't think so. The main check is still one byte (F instead of z), but the stack manipulation won't be any simpler, possibly even one or two commands worse.

@JamesHolderness Why shouldn't it? 69696 appears two positions before its natural position (overlapping with it). If overlaps with its natural position should be disregarded, you should probably say so in the challenge.

@JamesHolderness the relevant test cases were taking too long to check, so I just did up to 10. The intermediate test case should help.

That definitely increases the challenge.  Will you comment previous answers that fail the same way?  Note: I find these entertaining, but never answer, because all of my languages were designed with readability as a requirement.  :-)  Except for assembler and FORTH.  :-)

@JamesHolderness ^ I think this comment was meant to be addressed at you.

@WGroleau That shouldn't stop you.

@JamesHolderness Fixed. In Alice, this approach is actually a bit more expensive.

Wolfram Language (Mathematica), 75 bytes
(n=k=0;s="";While[n<#,If[!StringFreeQ[s,t=ToString[++k^2]],n++];s=s<>t];k)&

Try it online!
How it works
n keeps the number of early birds found so far, k the last number checked, s the string "1491625...". While n is too small, if s contains the next square, another early bird has been found, so we increment n. In any case, we extend s.
Once n reaches the input #, we return k, the last number checked and therefore the last early bird found.
On my laptop, takes about 53 seconds to compute the 53rd term of the sequence.

Husk, 13 bytes
!f§€oṁ₁ŀ₁N
d□

Try it online!
Explanation
The second line is a helper function which gives us the decimal digits of a number's square:
 □    Square.
d     Base-10 digits.

We can invoke this function on the main program using ₁.
!f§€oṁ₁ŀ₁N
 f§      N    Filter the list of natural numbers by the following fork g(n).
       ŀ        Get [0, 1, ... n-1]
     ṁ₁         Get the decimal digits of each value's square and concatenate
                them into one list. (A)
        ₁       And get the decimal digits of n² itself. (B)
    €           Check whether (A) contains (B) as a sublist.
!             Use the programs input as an index into this filtered list.

Kotlin, 79 bytes
{n->var m=n;var i=0;var s="";while(m>0){val k="${++i*i}";if(k in s)m--;s+=k};i}

Try it online!

REXX, 66 bytes
arg n,a
k=0
do i=1 until k=n
  k=k+(pos(i*i,a)>0)
  a=a||i*i
  end
say i

Try it online!

Bash, 76 69 bytes
Assume n is given into variable (i.e. n=10 foo.sh). Uses package grep. Any middle value is output (if allowed, -3 bytes).
while((n));do((b=++a*a));grep -q $b<<<$s&&((n--));s=$s$b;done;echo $a

How does it work?
while ((n)); do  # while n != 0 (C-style arithmetic)
  ((b = ++a*a))  # Increment a and let b = a*a
    # Non-existent value is treated as zero
  grep $b<<<$s   # Search for b in s
    && ((n--))   # If found, decrement n
  s=$s$b         # Append b to s
done
echo $a

@James Here it goes.