A062181 Harmonic mean of digits is 3.
3, 26, 33, 62, 236, 244, 263, 326, 333, 362, 424, 442, 623, 632, 1999, 2266, 2336, 2344, 2363, 2434, 2443, 2626, 2633, 2662, 3236, 3244, 3263, 3326, 3333, 3362, 3424, 3442, 3623, 3632, 4234, 4243, 4324, 4342, 4423, 4432, 6226, 6233, 6262, 6323, 6332
Offset: 1
Links
- Eric Weisstein's World of Mathematics, Harmonic Mean.
- Wikipedia, Harmonic mean.
Programs
-
Mathematica
Do[ h = IntegerDigits[n]; If[ Sort[h][[1]] != 0 && Length[h]/Apply[Plus, 1/h] == 3, Print[n]], {n, 1, 10^4}]
-
Python
from fractions import Fraction def hm(n): s = str(n) return None if '0' in s else len(s)/sum(Fraction(1, int(d)) for d in s) def aupto(limit): return [m for m in range(limit+1) if hm(m) == 3] print(aupto(6332)) # Michael S. Branicky, Mar 26 2021
Extensions
More terms from Henry Bottomley, Jul 25 2001