Untropee,
<script>
function fn(x)
{
return 1 + Math.log(x)*Math.log(x)/2|0
}
function foo(y)
{
return Math.ceil(Math.exp(Math.sqrt((y - 1)*2)))
}
for (var i=1; i<=100; i++) {document.write("n = "+i+" x = "+foo(i)+ " test = "+ (fn(foo(i)) == i && fn(foo(i)-1) != i) + "<br>")}
</script>