It looks like you're trying to create a generator function T(n+1) where n+1 is m^2 so rather than juggle the formula as you did solving for m^2
you could say n+1 = m^2 and hence n=m^2 - 1 and sub that in for each n
#3
22990atinesh
143
1
Your saying it this way
##T(n+1) = T(n) + \lfloor \sqrt{n+1} \rfloor##
##m^2 = n + 1##
##T(m^2) = T(m^2 - 1) + \lfloor \sqrt{m^2} \rfloor##
on solving it through recursion tree method I'm coming up with
##T(m^2) = m + \sqrt{m^2-1} + \sqrt{m^2-2} + \sqrt{m^2-3} + ... + \sqrt{m^2-(m^2-3)} + 1##
Now how can we solve this equation
I'm not sure it's possible without the integer floor function keeping the pattern simple. It's a non-linear recurrence equation. Link to wolfram example:
A linear recurrence equation has the form T(n) = a T(n-1) + b T(n-2) + c T(n-3) ... . For example the Fibonacci numbers are T(n) = T(n-1) + T(n-2), T(1) = 1, T(0) = 0. These can't be solved, but can be converted into a matrix form: