Thank you so much ! :) On Fri, Nov 6, 2009 at 11:00 AM, Prunthaban Kanthakumar < pruntha...@gmail.com> wrote:
> On a related note, > The solution I gave you is to find the nth element in the kth series. > If you want to sum the first 'n' elements of the kth series (call the > function s(n,k)), then it is easy to see that, > > *s(n,k) = f(n+1, k+1) - 1* > > where f(n+1, k+1) is the (n+1)th element in the (k+1)th series. > This can also be easily done using the summation operator of 'finite > calculus'. > > > On Fri, Nov 6, 2009 at 10:50 AM, Prunthaban Kanthakumar < > pruntha...@gmail.com> wrote: > >> This is a 'finite calculus' (differences & summations) problem. >> You can solve it using difference operator (actually its inverse which >> gives you the discrete integration which is nothing but summation). >> If you do not know finite calculus, Google for it (or refer Concrete >> Mathematics by Knuth). >> >> The solution for any k is. >> >> *f(n) = nC(k+1) + nC(k-1) + nC(k-3) + .... (all the way down to nC0 or >> nC1 depends on k is odd or even).* >> >> Here nCr is the binomial coefficient "n choose r". >> >> Eg: Let k = 3, n = 4 >> >> f(4) = 4C4 + 4C2 + 4C0 = 1 + 6 + 1 = 8 >> >> Another, k = 3 and n = 5 >> >> f(5) = 5C4 + 5C2 + 5C0 = 5 + 10 + 1 = 16 >> >> >> On Wed, Nov 4, 2009 at 11:23 AM, abhijith reddy <abhijith200...@gmail.com >> > wrote: >> >>> Is there a way to find the sum of the Kth series ( Given below) >>> >>> K=0 S={1,2,3,4,5,6,....} >>> K=1 S={1,2,4,7,11,16..} common diff = 1,2,3,4 5 ... >>> K=2 S={1,2,4,8,15,26...} common diff = 1,2,4,7 11... (series with >>> K=1) >>> K=3 S={1,2,4,8,16,31...} common diff = 1,2,4,8 15... (series with >>> K=2) >>> >>> Note that the common difference of Kth series is the (K-1) series >>> >>> Any ideas ?? >>> >>> -- >>> >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algoge...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >>> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.