cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A187040 Numbers for which Midy's theorem holds.

This page as a plain text file.
%I A187040 #35 Jan 09 2024 02:59:40
%S A187040 7,11,13,14,17,19,22,23,26,28,29,34,35,38,44,46,47,49,52,55,56,58,59,
%T A187040 61,65,68,70,73,76,77,85,88,89,91,92,94,95,97,98,101,103,104,109,110,
%U A187040 112,113,115,116,118,121,122,127,130,131,133,136,137,139,140,143,145,146,149,152,154,157,161,167,169,170,175,176,178,179,181,182,184,188,190,193,194,196,197
%N A187040 Numbers for which Midy's theorem holds.
%C A187040 Martin gives generalizations of Midy's theorem that characterize the numbers in this sequence. See theorem 8. - _T. D. Noe_, Mar 02 2011
%C A187040 García-Pulgarín Gilberto and Giraldo Hernán give the characterization of the numbers that satisfy Midy's property.
%H A187040 Gilberto García-Pulgarín and Hernán Giraldo, <a href="http://www.emis.de/journals/INTEGERS/papers/j18/j18.Abstract.html">Characterizations of Midy's property,</a> Integers 9 (2009), A18, 191--197. MR2506150 (2010f:11013).
%H A187040 Joseph Lewittes, <a href="http://arxiv.org/abs/math/0605182">Midy's theorem for periodic decimals</a>, arXiv:math/0605182 [math.NT], 2006.
%H A187040 Harold W. Martin, <a href="http://www.emis.de/journals/INTEGERS/papers/h3/h3.Abstract.html">Generalizations of midy’s theorem on repeating decimals</a>, INTEGERS 7 (2007), #A03.
%H A187040 Étienne Midy, <a href="https://archive.org/details/1014596483">De quelques propriétés des nombres et des fractions décimales périodiques</a>, 1836.
%H A187040 Wikipedia, <a href="http://en.wikipedia.org/wiki/Midy%27s_theorem">Midy's theorem</a>
%p A187040 fct1 := proc(an) local i,st:  st := 0:
%p A187040 for i from 1 to nops(an)/2 do
%p A187040    st := op(i,an)*10^(nops(an)/2-i) + st
%p A187040 od: RETURN(st):  end:
%p A187040 fct2 := proc(an) local i,st:  st := 0:
%p A187040 for i from nops(an)/2+1 to nops(an) do
%p A187040    st := op(i,an)*10^(nops(an)/2-i+nops(an)/2) + st
%p A187040 od:  RETURN(st):  end:
%p A187040 A187040 := proc(n) local st:
%p A187040 st := op(4,numtheory[pdexpand](1/n));
%p A187040 if (modp(nops(st),2) = 0) then
%p A187040    if (10^(nops(st)/2)-1 - (fct1(st)+fct2(st)) = 0) then
%p A187040       RETURN(n)
%p A187040 fi: fi: end:  seq(A187040(n), n=2..200);
%t A187040 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 *)
%Y A187040 Cf. A028416, A187041.
%K A187040 nonn,base
%O A187040 1,1
%A A187040 _Jani Melik_, Mar 02 2011
%E A187040 Corrected by _T. D. Noe_, Mar 02 2011