Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-152-writing-one-half-as-a-sum-of-inverse-squares.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.2 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4041000cf542c50ff17 Problem 152: Writing one half as a sum of inverse squares 5 301783 problem-152-writing-one-half-as-a-sum-of-inverse-squares

--description--

There are several ways to write the number \frac{1}{2} as a sum of inverse squares using distinct integers.

For instance, the numbers {2,3,4,5,7,12,15,20,28,35} can be used:

\frac{1}{2} = \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \frac{1}{5^2} + \frac{1}{7^2} + \frac{1}{{12}^2} + \frac{1}{{15}^2} + \frac{1}{{20}^2} + \frac{1}{{28}^2} + \frac{1}{{35}^2}

In fact, only using integers between 2 and 45 inclusive, there are exactly three ways to do it, the remaining two being: {2,3,4,6,7,9,10,20,28,35,36,45} and {2,3,4,6,7,9,12,15,28,30,35,36,45}.

How many ways are there to write the number \frac{1}{2} as a sum of inverse squares using distinct integers between 2 and 80 inclusive?

--hints--

sumInverseSquares() should return 301.

assert.strictEqual(sumInverseSquares(), 301);

--seed--

--seed-contents--

function sumInverseSquares() {

  return true;
}

sumInverseSquares();

--solutions--

// solution required