The output of
hilarious
can be approximated as
, where
is a
positive integer
. What is
?
1 2 3 4 5 6 7 8 9 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
By the Code, we see that i increases as the n t h triangular number i.e. 2 n ( n + 1 ) .
Hence, we need to find approximately the number of times the while loop will run that'll give the output i.e. 's'.
i.e to find a k such that: 2 k ( k + 1 ) = n Solving this Quadratic Eqn. will give: k = − 0 . 5 + 0 . 2 5 + 2 n ≈ 2 n giving a = 2