%I #9 Mar 26 2021 12:25:54
%S 3,26,33,62,236,244,263,326,333,362,424,442,623,632,1999,2266,2336,
%T 2344,2363,2434,2443,2626,2633,2662,3236,3244,3263,3326,3333,3362,
%U 3424,3442,3623,3632,4234,4243,4324,4342,4423,4432,6226,6233,6262,6323,6332
%N Harmonic mean of digits is 3.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HarmonicMean.html">Harmonic Mean</a>.
%H Wikipedia, <a href="http://www.wikipedia.org/wiki/Harmonic_mean">Harmonic mean</a>.
%t Do[ h = IntegerDigits[n]; If[ Sort[h][[1]] != 0 && Length[h]/Apply[Plus, 1/h] == 3, Print[n]], {n, 1, 10^4}]
%o (Python)
%o from fractions import Fraction
%o def hm(n):
%o s = str(n)
%o return None if '0' in s else len(s)/sum(Fraction(1, int(d)) for d in s)
%o def aupto(limit): return [m for m in range(limit+1) if hm(m) == 3]
%o print(aupto(6332)) # _Michael S. Branicky_, Mar 26 2021
%Y Cf. A062179-A062185, A061383-A061388, A061423-A061425.
%K base,easy,nonn
%O 1,1
%A _Vladeta Jovovic_, Jun 12 2001
%E More terms from _Henry Bottomley_, Jul 25 2001
|