login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268643 Number of 1's in decimal representation of n. 23

%I #14 Dec 24 2022 03:39:44

%S 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 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 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 Number of 1's in decimal representation of n.

%H Robert Israel, <a href="/A268643/b268643.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = a(floor(n/10)) + 1 if n == 1 (mod 10), otherwise a(n) = a(floor(n/10)).

%F G.f. g(x) satisfies g(x) = x/(1-x^10) + (1-x^10)*g(x^10)/(1-x).

%p f:= n -> numboccur(1,convert(n,base,10)):

%p map(f, [$0..100]);

%t DigitCount[Range[0,120],10,1] (* _Harvey P. Dale_, Apr 08 2018 *)

%o (Python)

%o def A268643(n): return str(n).count('1') # _Chai Wah Wu_, Dec 23 2022

%Y Second column of A100910.

%K nonn,base

%O 0,12

%A _Robert Israel_, Feb 09 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)