This program have to calculate the numbers of partitions of a number using the euler formula(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Help in this program in matlab

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**