yaworsw/euler-manager

View on GitHub
data/problems/26.yml

Summary

Maintainability
Test Coverage
---
:id: 26
:name: Reciprocal cycles
:url: https://projecteuler.net/problem=26
:content: |+
  A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:

  > | <sup>1</sup>/<sub>2</sub> | =&nbsp; | 0.5 |
  > | <sup>1</sup>/<sub>3</sub> | =&nbsp; | 0.(3) |
  > | <sup>1</sup>/<sub>4</sub> | =&nbsp; | 0.25 |
  > | <sup>1</sup>/<sub>5</sub> | =&nbsp; | 0.2 |
  > | <sup>1</sup>/<sub>6</sub> | =&nbsp; | 0.1(6) |
  > | <sup>1</sup>/<sub>7</sub> | =&nbsp; | 0.(142857) |
  > | <sup>1</sup>/<sub>8</sub> | =&nbsp; | 0.125 |
  > | <sup>1</sup>/<sub>9</sub> | =&nbsp; | 0.(1) |
  > | <sup>1</sup>/<sub>10</sub> | =&nbsp; | 0.1 |

  Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that <sup>1</sup>/<sub>7</sub> has a 6-digit recurring cycle.

  Find the value of _d_ \< 1000 for which <sup>1</sup>/<sub><i>d</i></sub> contains the longest recurring cycle in its decimal fraction part.