cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A268643 Number of 1's in decimal representation of n.

This page as a plain text file.
%I A268643 #14 Dec 24 2022 03:39:44
%S A268643 0,1,0,0,0,0,0,0,0,0,1,2,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,
%T A268643 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
%U A268643 0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1
%N A268643 Number of 1's in decimal representation of n.
%H A268643 Robert Israel, <a href="/A268643/b268643.txt">Table of n, a(n) for n = 0..10000</a>
%F A268643 a(n) = a(floor(n/10)) + 1 if n == 1 (mod 10), otherwise a(n) = a(floor(n/10)).
%F A268643 G.f. g(x) satisfies g(x) = x/(1-x^10) + (1-x^10)*g(x^10)/(1-x).
%p A268643 f:= n -> numboccur(1,convert(n,base,10)):
%p A268643 map(f, [$0..100]);
%t A268643 DigitCount[Range[0,120],10,1] (* _Harvey P. Dale_, Apr 08 2018 *)
%o A268643 (Python)
%o A268643 def A268643(n): return str(n).count('1') # _Chai Wah Wu_, Dec 23 2022
%Y A268643 Second column of A100910.
%K A268643 nonn,base
%O A268643 0,12
%A A268643 _Robert Israel_, Feb 09 2016