#Retina, 144 bytes
Retina, 144 bytes
Input and output are in unary.
The 2nd-to-last line contains a space, and the two middle lines and the last line are empty.
{`(\b|)11+$
$&¶$&
m-1=`^(?=^(11)*(1?)).*$
$&,$2
(1+),1$
$1;,
1(?=1*;)
$%_
1+;
$%_
;|,
m-1=`^
1:
+`(1+):(11\1)
1 $2:
1+:$|:1+
-1=`(1+\b)
$#1
###Explanation
Explanation
{`(\b|)11+$ # Loop, Duplicate last line
$&¶$&
m-1=`^(?=^(11)*(1?)).*$ # Append ,n%2 to that line (number modulo 2)
$&,$2
(1+),1$ # Cube that number if odd
$1;,
1(?=1*;)
$%_
1+;
$%_
;|, # (Last stage of cubing number)
m-1=`^ # Integer square root of that number,
1: # borrowed and modified from another user's answer
+`(1+):(11\1)
1 $2:
1+:$|:1+
-1=`(1+\b)
$#1
Integer square root in Retina, by Digital Trauma