|
|
A214950
|
|
Denominator of sum of reciprocals of all nonzero digits of n in decimal representation.
|
|
6
|
|
|
1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 2, 1, 6, 4, 10, 3, 14, 8, 18, 3, 3, 6, 3, 12, 15, 2, 21, 24, 9, 4, 4, 4, 12, 2, 20, 12, 28, 8, 36, 5, 5, 10, 15, 20, 5, 30, 35, 40, 45, 6, 6, 3, 2, 12, 30, 3, 42, 24, 18, 7, 7, 14, 21, 28, 35, 42
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
dsr[n_] := Denominator[Total[1/Select[IntegerDigits[n], # > 0 &]]]; dsr /@ Range[0, 76] (* Jayanta Basu, Jul 13 2013 *)
|
|
PROG
|
(Haskell)
import Data.Ratio ((%), denominator)
a214950 = f 0 where
f y 0 = denominator y
f y x = f (y + if d == 0 then 0 else 1 % d) x'
where (x', d) = divMod x 10
(PARI) a(n) = my(d=digits(n)); denominator(sum(k=1, #d, if (d[k], 1/d[k]))); \\ Michel Marcus, Jan 26 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,frac
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|