Back to Freecodecamp

Problem 202: Laserbeam

curriculum/challenges/english/blocks/project-euler-problems-201-to-300/5900f4371000cf542c50ff49.md

latest1.3 KB
Original Source

--description--

Three mirrors are arranged in the shape of an equilateral triangle, with their reflective surfaces pointing inwards. There is an infinitesimal gap at each vertex of the triangle through which a laser beam may pass.

Label the vertices $A$, $B$ and $C$. There are 2 ways in which a laser beam may enter vertex $C$, bounce off 11 surfaces, then exit through the same vertex: one way is shown below; the other is the reverse of that.

There are 80840 ways in which a laser beam may enter vertex $C$, bounce off 1000001 surfaces, then exit through the same vertex.

In how many ways can a laser beam enter at vertex $C$, bounce off 12017639147 surfaces, then exit through the same vertex?

--hints--

laserbeam() should return 1209002624.

js
assert.strictEqual(laserbeam(), 1209002624);

--seed--

--seed-contents--

js
function laserbeam() {

  return true;
}

laserbeam();

--solutions--

js
// solution required