OFFSET
1,1
COMMENTS
Martin gives generalizations of Midy's theorem that characterize the numbers in this sequence. See theorem 8. - T. D. Noe, Mar 02 2011
García-Pulgarín Gilberto and Giraldo Hernán give the characterization of the numbers that satisfy Midy's property.
LINKS
Gilberto García-Pulgarín and Hernán Giraldo, Characterizations of Midy's property, Integers 9 (2009), A18, 191--197. MR2506150 (2010f:11013).
Joseph Lewittes, Midy's theorem for periodic decimals, arXiv:math/0605182 [math.NT], 2006.
Harold W. Martin, Generalizations of midy’s theorem on repeating decimals, INTEGERS 7 (2007), #A03.
Étienne Midy, De quelques propriétés des nombres et des fractions décimales périodiques, 1836.
Wikipedia, Midy's theorem
MAPLE
fct1 := proc(an) local i, st: st := 0:
for i from 1 to nops(an)/2 do
st := op(i, an)*10^(nops(an)/2-i) + st
od: RETURN(st): end:
fct2 := proc(an) local i, st: st := 0:
for i from nops(an)/2+1 to nops(an) do
st := op(i, an)*10^(nops(an)/2-i+nops(an)/2) + st
od: RETURN(st): end:
A187040 := proc(n) local st:
st := op(4, numtheory[pdexpand](1/n));
if (modp(nops(st), 2) = 0) then
if (10^(nops(st)/2)-1 - (fct1(st)+fct2(st)) = 0) then
RETURN(n)
fi: fi: end: seq(A187040(n), n=2..200);
MATHEMATICA
okQ[n_] := Module[{ps = First /@ FactorInteger[n], d, len}, If[n < 2 || Complement[ps, {2, 5}] == {}, False, d = RealDigits[1/n, 10][[1, -1]]; len = Length[d]; EvenQ[len] && Union[Total[Partition[d, len/2]]] == {9}]]; Select[Range[200], okQ] (* T. D. Noe, Mar 02 2011 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jani Melik, Mar 02 2011
EXTENSIONS
Corrected by T. D. Noe, Mar 02 2011
STATUS
approved