Number of values between input and next highest square Given a positive square number as input. Output the number of values between the input and next highest square. 

Example

Input: 1

Output: 2

Reason: The numbers 2 and 3 are between 1 and 4, the next highest square

Input: 4 

Output: 4

Reason: The numbers 5, 6, 7, 8 are between 4 and 9
Brain-Flak, 38, 22 bytes

{([[]](({})))}{}([]&lt;&gt;)


Try it online!

I'm very proud of this answer. IMO, one of my best brain-flak golfs. 

How does it work?

As many other users have pointed out, the answer is simply sqrt(n) * 2. However, calculating the square root in brain-flak is very very nontrivial. Since we know the input will always be a square, we can optimize. So we write a loop that subtracts 

1, 3, 5, 7, 9...


from the input, and track how many times it runs. Once it hits 0, the answer is simply the last number we subtracted minus one.

Originally, I had pushed a counter on to the other stack. However, we can use the main stack itself as a counter, by increasing the stack height.

#While TOS (top of stack, e.g. input) != 0:
{

    #Push:
    (

      #The negative of the height of the stack (since we're subtracting)
      [[]]

      #Plus the TOS pushed twice. This is like incrementing a counter by two
      (({}))
    )

#Endwhile
}

#Pop one value off the main stack (or in other words, decrement our stack-counter)
{}

#And push the height of the stack onto the alternate stack
([]&lt;&gt;)


In python-y pseudocode, this is basically the following algorithm:

l = [input]
while l[-1] != 0:   #While the back of the list is nonzero
    old_len = len(l)
    l.append(l[-1])
    l.append(l[-1] - old_len)

l.pop()

print(len(l))