Abandoned, incompolete; read carefully Question: let A be the set of positive integers whose decimal expansions do not contain (say) a 2 nor a 5. What is S=\sum_{n \in A} (1/n) ? Answer: Clearly A is the disjoint union of its subsets A_k of such numbers of exactly k digits, and S = \sum_k S_k where the sums S_k are defined similarly. Expand S_k as Sum_{n in A_k} 1/n = Sum_{m in A_{k-1}} ( 1/(10n) + 1/(10n+1) + 1/(10n+3) + ... + 1/(10n+9) ) These eight terms sum to something less than 8/(10n); we may obtain a lower bound (and more accurate expressions) by computing a Taylor series in z=1/n : the sum is (8/10) (1/n) - (38/100) (1/n)^2 + (256/1000) (1/n)^3 - ... This allows us to evaluate S_k as (8/10) S_{k-1} -(.38) Sum (1/n^2, n in A_{k-1}) + ... More precisely, S_k - (.8) S_{k-1} is negative and of magnitude bounded above by .38 Sum(1/n^2) . The sum is to be taken over A_{k-1} only, but we may obtain a weaker upper bound by summing over _all_ (k-1)-digit numbers. That sum is in turn less than the integral of 1/x^2 over the range 10^(k-2) - 1 to 10^(k-1) - 2, which is (.9) 10^(-(k-2)) + (.98) 10^(-2(k-2)) + ... A tiny tightening of these inequalities, and a shift of index, gives .8 S_k - .38 * 9/10^k < S_{k+1} < .8 S_k. By induction we then have (.8)^n S_k - .38 * (9/10^k)( (.8)^n - (.1)^n)/(.7) < S_{k+n} < (.8)^n S_k It is then simple to sum the geometric series to estimate S_k + S_{k+1} + ... : it's less than 5 S_k, but by no more than 19/10^k . Thus our idea is simply to evaluate by hand the first few S_k's, and when we tire we declare the sum of all of them to be the sum of all but the last, plus 5 times the last. Our answer will be too large but by at most (1/2) 10^( - (k-2) ), i.e., the answer is "correct to within k-2 decimals". ok:=proc(n) local k : if n=0 then true else k:=n mod 10: if (k=2) or (k=5) then false else ok( (n-k)/10 ) fi:fi:end: Digits:=30: # :-) for k from 1 to 5 do S:=0: for i from 10^(k-1) to 10^k-1 do if ok(i) then S:=S+evalf(1/i) fi:od: S.k:=evalf(S): od: print(seq(S.k, k=1..5)); 2.12896825396825396825396825397 1.39055196196383020583358259504 1.09102512106214326702081773525 .87114105194401603041413667953 .69677879363656275519104058389 for k to 5 do lprint(add(S.j,j=1..k-1) + 5*S.k) od: 10.6448412698412698412698412699 9.08172806378740499742188122917 8.97464582124280050919163952526 8.96625059671430759317905198192 8.96558035712105724747770818327 Now, we can improve our estimates a little. The set A_k contains only N = 7*8^(k-1) of the k-digit numbers, so comparing to the smallest k-digit numbers, the sum of 1/n^2 on this set will be less than (N)/(10^(2(k-1))) = (175/2)(.08)^k, an improvement over our previous (.9)(.1)^k for large k. Thus the sum of all S's starting with S_k will differ from 5S_k by no more than some multiple of (.08)^k; a good multiple is, empirically, about 17.78 . This leads to an estimated value of the sum of all S's to be 8.96552