OFFSET
1,1
COMMENTS
LINKS
Arkadiusz Wesolowski, Table of n, a(n) for n = 1..1000
Wikipedia, Midy's theorem
EXAMPLE
1/17 = .058823529..., therefore 17 is a term.
1/21 = .04761904761..., therefore 21 is not a term.
MATHEMATICA
lst = {}; Do[l = (n + 1)/2; d = Flatten@RealDigits[1/n, 10, l]; If[Join[Table[0, {-1*Last@d}], Most@d][[l]] == 9, AppendTo[lst, n]], {n, 1, 491, 2}]; lst
PROG
(PARI) forstep(n=1, 491, 2, s=(n+1)/2; "\p s"; if(Mod(floor(10^s/n), 10)==9, print1(n, ", "))); \\ Arkadiusz Wesolowski, Aug 23 2013
(Python)
from itertools import count, islice
def A216664_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue+1-startvalue%2, 1), 2):
if 10**((n+1)//2)//n % 10 == 9:
yield n
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Arkadiusz Wesolowski, Sep 14 2012
STATUS
approved