Python 3, 70(削除) 70 (削除ここまで) 69 bytes
import math
f=lambda n,d=10d=1:n>d and n%d*~-math.gcd(n//d,n%d)+f(n,10*d)
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchangeimport math
f=lambda n,d=10d=1:n>d and n%d*~-math.gcd(n//d,n%d)+f(n,10*d)