Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-78-coin-partitions.english.md
Oliver Eyton-Williams f1c9b08cf3 fix(curriculum): add isHidden: false to challenges
This includes certificates (where it does nothing), but does not
include any translations.
2020-05-25 16:25:19 +05:30

1.3 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f3ba1000cf542c50fecd 5 false Problem 78: Coin partitions 302191

Description

Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7.

Coin piles
OOOOO
OOOO   O
OOO   OO
OOO   O   O
OO   OO   O
OO   O   O   O
O   O   O   O   O

Find the least value of n for which p(n) is divisible by one million.

Instructions

Tests

tests:
  - text: <code>coinPartitions()</code> should return a number.
    testString: assert(typeof coinPartitions() === 'number');
  - text: <code>coinPartitions()</code> should return 55374.
    testString: assert.strictEqual(coinPartitions(), 55374);

Challenge Seed

function coinPartitions() {
  // Good luck!
  return true;
}

coinPartitions();

Solution

// solution required