OFFSET
0,12
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = a(floor(n/10)) + 1 if n == 1 (mod 10), otherwise a(n) = a(floor(n/10)).
G.f. g(x) satisfies g(x) = x/(1-x^10) + (1-x^10)*g(x^10)/(1-x).
MAPLE
f:= n -> numboccur(1, convert(n, base, 10)):
map(f, [$0..100]);
MATHEMATICA
DigitCount[Range[0, 120], 10, 1] (* Harvey P. Dale, Apr 08 2018 *)
PROG
(Python)
def A268643(n): return str(n).count('1') # Chai Wah Wu, Dec 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Feb 09 2016
STATUS
approved