OFFSET
0,9
COMMENTS
The total number of digits >= 7 occurring in all the numbers 0, 1, 2, ..., n (in decimal representation). - Hieronymus Fischer, Jun 10 2012
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 0..10000
FORMULA
From Hieronymus Fischer, Jun 10 2012: (Start)
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)).
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)).
a(10^m-1) = 3*m*10^(m-1).
(this is total number of digits >= 7 occurring in all the numbers with <= m places).
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)
MAPLE
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:
seq(add(p(i), i=0..n), n=0..90);
MATHEMATICA
Accumulate[Table[Count[IntegerDigits[n], _?(#>6&)], {n, 0, 90}]] (* Harvey P. Dale, Sep 04 2018 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Feb 03 2005
EXTENSIONS
More terms from Emeric Deutsch, Feb 23 2005
STATUS
approved