1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Reduce the sequenceor how to calculate it efficiently

  1. Jul 5, 2012 #1
    Sequence is
    (in Summation notation)
    SUMMATION[from k=0 to k=floor(n/2)] (n-k)C(k) * 2(n-k-1)
    refer to this image
    http://i.snag.gy/tFI7e.jpg
    after expanding it becomes
    (n)C(0)*2(n-1) + (n-1)C(1)*2(n-2) + (n-2)C(2) * 2(n-3) +....
    I want to calculate the value of function for a large value of n(up to
    1010, and ans is to be found MODULUS to some prime number..like
    1010+7).

    Please simplify the series if possible or let me know the way how to
    solve it efficiently.
     
  2. jcsd
  3. Jul 5, 2012 #2
    Mathematica code

    Code (Text):
    Sum[Binomial[n - k, k]*2^(n - k - 1), {k, 0, Floor[n/2]}]
    you can use wolfram alpha to evaluate the exact form, if you don't have mathematica installed.

    answer is attached
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Reduce the sequenceor how to calculate it efficiently
Loading...