Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-159-digital-root-sums-of-factorisations.md
gikf bfc21e4c40 fix(curriculum): clean-up Project Euler 141-160 (#42750)
* fix: clean-up Project Euler 141-160

* fix: corrections from review

Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* fix: use different notation for consistency

* Update curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.md

Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>

Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-14 13:05:12 +02:00

1.7 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f40c1000cf542c50ff1e Problem 159: Digital root sums of factorisations 5 301790 problem-159-digital-root-sums-of-factorisations

--description--

A composite number can be factored many different ways.

For instance, not including multiplication by one, 24 can be factored in 7 distinct ways:

$$\begin{align} & 24 = 2 \times 2 \times 2 \times 3\\ & 24 = 2 \times 3 \times 4 \\ & 24 = 2 \times 2 \times 6 \\ & 24 = 4 \times 6 \\ & 24 = 3 \times 8 \\ & 24 = 2 \times 12 \\ & 24 = 24 \end{align}$$

Recall that the digital root of a number, in base 10, is found by adding together the digits of that number, and repeating that process until a number arrives at less than 10. Thus the digital root of 467 is 8.

We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number. The chart below demonstrates all of the DRS values for 24.

Factorisation Digital Root Sum
2x2x2x3 9
2x3x4 9
2x2x6 10
4x6 10
3x8 11
2x12 5
24 6

The maximum Digital Root Sum of 24 is 11. The function mdrs(n) gives the maximum Digital Root Sum of n. So mdrs(24) = 11.

Find \sum{mdrs(n)} for 1 &lt; n &lt; 1,000,000.

--hints--

euler159() should return 14489159.

assert.strictEqual(euler159(), 14489159);

--seed--

--seed-contents--

function euler159() {

  return true;
}

euler159();

--solutions--

// solution required