Print my clock's alarm sound Write the shortest program that prints the sound my alarm clock makes, and stops after an inputted number of beeps.
For reference, here is the sound my alarm makes:
beep beep beep beep beep beepbeep beepbeep beepbeep beepbeep beepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeep

Basically beep, beepbeep, beepbeepbeep, and beepbeepbeepbeep repeated 5 times each with spaces in between, followed by a beepbeep...beep which is 25 beeps long with no spaces in between (does beep still sound like a word to you?).
Your program should take a number as input (assume it's between 0 and 75), and stop printing after that many beeps.
Note: Your program should stop after that many beeps, not after that many groups of beeps. For example, 7 will return beep beep beep beep beep beepbeep.
Whitespace in between beeps must follow the exact pattern above, although any trailing whitespace or unsuppressable output from your compiler or interpreter is allowed.
Test cases:
3   beep beep beep
0   
1   beep
7   beep beep beep beep beep beepbeep
8   beep beep beep beep beep beepbeep beep
55  beep beep beep beep beep beepbeep beepbeep beepbeep beepbeep beepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeepbeep
67  beep beep beep beep beep beepbeep beepbeep beepbeep beepbeep beepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeep beepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeepbeep

This is code golf, so the shortest answer in bytes, per language, wins.
JavaScript (ES7),  55  54 bytes

f=n=&gt;n?f(n-1)+'beep'+[&quot; &quot;[n&gt;50|n%~~(n**=.4)^52%~n]]:''

Try it online!
How?
Given \$1\le n&lt; 50\$, we want to know the number of consecutive beeps that are expected in this part of the sequence. The exact value is given by:
$$\left\lfloor\sqrt{\frac{2n}{5}}+\frac{1}{2}\right\rfloor$$
which is a slightly modified version of A002024.
But in practice, we only need an exact value on the boundaries of the runs of beeps and we can deal with a few off-by-one errors. That's why we instead compute the following approximation:
$$k=\left\lfloor n^{2/5}\right\rfloor$$
We need to insert a space whenever one of the following conditions is satisfied:

\$k=1\$ and \$n\bmod 1=0\$ (the 2nd part being always true)
\$k=2\$ and \$n\bmod 2=1\$
\$k=3\$ and \$n\bmod 3=0\$
\$k=4\$ and \$n\bmod 4=2\$

All the above conditions can be merged into:
$$(n \bmod k) = (52 \bmod (k+1))$$
\$52\$ being the smallest integer \$x&gt;0\$ such that \$x\bmod 3=1\$, \$x\bmod 4=0\$ and \$x\bmod 5=2\$.
We need an additional test for \$n\ge50\$, where all remaining beeps are concatenated together. Otherwise, unwanted spaces would be inserted, starting at \$n=54\$.
Hence the final JS expression:
n &gt; 50 | n % ~~(n **= 0.4) ^ 52 % ~n

which evaluates to 0 when a space must be inserted.

JavaScript (ES7), 55 bytes
A simpler approach using a lookup bit mask.

f=n=&gt;n?f(--n)+'beep'+(0x222222492555F/2**n&amp;1?' ':''):''

Try it online!