Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 1873. Break it up! Break it up!

Created by James

You have N pennies. Write a Matlab script that will reveal how many different ways you can break up those pennies. For example, with 5 pennies, there are seven different ways you can divide them:

  • (1,1,1,1,1)
  • (2,1,1,1)
  • (2,2,1)
  • (3,2)
  • (3,1,1)
  • (4,1)
  • (5)

The order of the coins does not matter, so (2,2,1) is considered the same combination as (2,1,2). You can assume that N will always be a positive integer.

Tags

Problem Group

Solution Statistics

15 correct solutions 19 incorrect solutions
Last solution submitted on Jan 08, 2016

Problem Comments