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!)
A102680 Number of digits >= 7 in the decimal representations of all integers from 0 to n. 2

%I #23 Nov 17 2022 05:28:58

%S 0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3,3,4,5,6,6,6,6,6,6,6,6,7,8,9,9,9,9,9,

%T 9,9,9,10,11,12,12,12,12,12,12,12,12,13,14,15,15,15,15,15,15,15,15,16,

%U 17,18,18,18,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,30,32,34,35,36

%N Number of digits >= 7 in the decimal representations of all integers from 0 to n.

%C The total number of digits >= 7 occurring in all the numbers 0, 1, 2, ..., n (in decimal representation). - _Hieronymus Fischer_, Jun 10 2012

%H Hieronymus Fischer, <a href="/A102680/b102680.txt">Table of n, a(n) for n = 0..10000</a>

%F From _Hieronymus Fischer_, Jun 10 2012: (Start)

%F a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 7/10)*(2n + 2 - (2/5 + floor(n/10^j + 7/10))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m=floor(log_10(n)).

%F a(n) = (n+1)*A102679(n) + (1/2)*Sum_{j=1..m+1} (((-2/5)*floor(n/10^j + 7/10) + floor(n/10^j))*10^j - (floor(n/10^j + 7/10)^2 - floor(n/10^j)^2)*10^j), where m=floor(log_10(n)).

%F a(10^m-1) = 3*m*10^(m-1).

%F (this is total number of digits >= 7 occurring in all the numbers with <= m places).

%F G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(7*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

%p p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=7 then ct:=ct+1 else ct:=ct fi od: ct: end:

%p seq(add(p(i),i=0..n), n=0..90);

%p # _Emeric Deutsch_

%t Accumulate[Table[Count[IntegerDigits[n],_?(#>6&)],{n,0,90}]] (* _Harvey P. Dale_, Sep 04 2018 *)

%Y Partial sums of A102679.

%Y Cf. A027868, A054899, A055640, A055641, A102669-A102685, A117804, A122840, A122841, A160093, A160094, A196563, A196564. Partial sums of A102669.

%Y Cf. A000120, A000788, A023416, A059015 (for base 2).

%K nonn,base,easy

%O 0,9

%A _N. J. A. Sloane_, Feb 03 2005

%E More terms from _Emeric Deutsch_, Feb 23 2005

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 April 25 12:53 EDT 2024. Contains 371969 sequences. (Running on oeis4.)