@ Sajan, I do agree that Narayan did a great to explain the formula. What I'm saying that it doesn't give me maint4 from the following list
maint1 , maint4, maint7 , maint10 , maint49 , vaint4 , vaint9
and the search key being maint5
I think the closest match would be maint4 from this list...