OFFSET
1,1
LINKS
David W. Wilson, Table of n, a(n) for n = 1..10000 (n <= 200 from R. J. Mathar)
EXAMPLE
a(13)=23 since 1/23=.04347826086956521739{13}... is the first to contain 13.
1/6=.16666... so a(n)=6 for n=1,6,16,66,166,666,1666,6666, ...
MATHEMATICA
foundQ[n_, m_] := (idn = IntegerDigits[n]; ln = Length[idn]; rdm = Most[ Flatten[ RealDigits[1/m, 10, lm = 2* Length[ Flatten[ RealDigits[1/m]]]]]]; found = False; Do[If[idn === Take[rdm, {k, k+ln-1}], found = True; Break[]], {k, 1, lm-ln+1}]; found); a[n_] := (m = 2; While[ True, If[foundQ[n, m], Break[], m++]]; m); a[n_ /; n > 1 && IntegerQ[ Log[10, n]]] := 10; a[n_ /; n > 1 && Union[ IntegerDigits[n]] == {1}] := 9; Table[a[n], {n, 1, 76}] (* Jean-François Alcover, Oct 24 2011 *)
Table[Function[r, SelectFirst[Range[2, 10^3], Length@ SequencePosition[ If[Depth@ # == 3, Flatten@ Join[#, Table[Last@ #, Length@ # + Length@ r]], PadRight[#, Length@ # + Length@ r]] &@ First@ RealDigits[1/#], r] > 0 &]]@ IntegerDigits@ n, {n, 120}] (* Michael De Vlieger, May 14 2016, Version 10.1 *)
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved