hi ananth see the distance travelled by the ball in nth second = dist. travelled by it in n seconds(from start) - dist. travelled by it in (n-1)seconds (from start)
= (un + a/2n^2) - (u(n-1) + a/2(n-1)^2)
= u(1) + a/2(2n-1)
this is the formula used by love_hatethatsome. here u is the initial velocity of the ball when it is thrown.(from derivation) & not when it is in the (n-1)th second of its motion. hence u is taken as zero.
Hope you understood