Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help in this program in matlab

  1. Nov 15, 2011 #1
    This program have to calculate the numbers of partitions of a number using the euler formula
    So, here is the program i have done, i don't know where is the mistakes, and I would greatly appreciate to help me.
    http://mathworld.wolfram.com/PartitionFunctionP.html#eqn11

    function fn = euler(n)

    if n == 0
    fn = 1;
    return
    else
    for i = 1 : 1 : n
    fn = ((-1)^ (i + 1)) * euler(n - i * (3 * i - 1) / 2 ) + euler(n - i * (3 * i + 1 ) / 2);
    return
    end
    end
    end
     
    Last edited: Nov 15, 2011
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted