Data: You are the following sequence of numbers 1,2,2,3,3,3,4,4,4,4,... Basically each number repeats itself accordingly to its value .

Requirement: Provide an algorithm that will return the Nth element of the sequence ( N will be given by input ) .

**The algorithm must run in a constant time ( it should not depend on the value of N )**

I tried some wild ideas but it didn't work so far , so please have a try. Enjoy solving !