Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm searching for a formula to create

share|cite|improve this question
It's on OEIS, in the Maple section. – Peter Taylor Feb 17 '11 at 13:05

1 Answer 1

I would use a recursion. With [the coins and notes] $c(1)$, $c(2)$, $c(3)$,... $c(m)$ in order, smallest first, I would start with $$b(i,j) = 0 \textrm{ for } j<0 \textrm{ or } i<0$$ $$b(i,0) = 1 $$ $$b(0,j) = 0 \textrm{ for } j>0$$ $$b(i,j) = b(i-1,j)+b(i,j-c(j)) \textrm{ for } i,j>0$$ then $b(i,j)$ is the number of ways of making $i$ where the largest part is no bigger than $c(j)$.

So A057537($n$) and similar sequences are simply $b(n,m)$. If the $c(j)$ represent a very large or infinite collection, then you only need to take $m$ large enough, i.e. so $c(m+1)$ is greater than $n$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.