yaworsw/euler-manager

View on GitHub
data/problems/417.yml

Summary

Maintainability
Test Coverage
---
:id: 417
:name: Reciprocal cycles II
:url: https://projecteuler.net/problem=417
:content: "A unit fraction contains 1 in the numerator. The decimal representation
  of the unit fractions with denominators 2 to 10 are given:\n\n> | <sup>1</sup>/<sub>2</sub>
  | =&nbsp; | 0.5 |\n> | <sup>1</sup>/<sub>3</sub> | =&nbsp; | 0.(3) |\n> | <sup>1</sup>/<sub>4</sub>
  | =&nbsp; | 0.25 |\n> | <sup>1</sup>/<sub>5</sub> | =&nbsp; | 0.2 |\n> | <sup>1</sup>/<sub>6</sub>
  | =&nbsp; | 0.1(6) |\n> | <sup>1</sup>/<sub>7</sub> | =&nbsp; | 0.(142857) |\n>
  | <sup>1</sup>/<sub>8</sub> | =&nbsp; | 0.125 |\n> | <sup>1</sup>/<sub>9</sub> |
  =&nbsp; | 0.(1) |\n> | <sup>1</sup>/<sub>10</sub> | =&nbsp; | 0.1 |\n\nWhere 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.\n\nUnit fractions whose denominator has no other
  prime factors than 2 and/or 5 are not considered to have a recurring cycle.  \nWe
  define the length of the recurring cycle of those unit fractions as 0.\n\nLet L(n)
  denote the length of the recurring cycle of 1/n. You are given that ∑L(n) for 3
  ≤ n ≤ 1 000 000 equals 55535191115.\n\nFind ∑L(n) for 3 ≤ n ≤ 100 000 000\n\n"