FERMAT 2015 Problem 25

There are F fractions \displaystyle\frac mn with the properties:

  • m$ and n are positive integers with $m<n,
  • \frac mn is in lowest terms,
  • n$ is not divisible by the square of any integer larger than 1, and
  • the shortest sequence of consecutive digits that repeats consecutively and indefinitely in the decimal equivalent of \displaystyle\frac mn has length 6.
    (Note: The length of the shortestsequence of consecutive digits that repeats consecutively and indefinitely in 0.12\overline{745}=0.12745745745745\dots is 3 and the length of the shortest sequence of consecutive digits that repeats consecutively and indefinitely in 0.\overline5 is 1.)

We define G=F+p, where the integer F has p digits. What is the sum of the squares of the digits of G?

Answer Choices
A. 170
B. 168
C. 217
D. 195
E. 181