| MATHEMATICA
|
a[n_] := a[n] = Module[{l, p, m, k},
l = {3/11, 847/45, 143/6, 7/3, 10/91, 3/7, 36/325, 1/2, 36/5};
If[n == 1, b[0] = 10; a[0] = 0, a[n - 1]]; p = b[n - 1];
For[m = 1, True, m++,
For[k = 1, !IntegerQ[p*l[[k]]], k++];
p = p*l[[k]]; If[10^(Length@IntegerDigits[p]-1) == p, Break[]]];
b[n] = p; m + a[n - 1]];
Array[a, 20] (* Jean-François Alcover, Apr 02 2021, after Alois P. Heinz *)
|