|
|
A102678
|
|
Number of digits >= 6 in the decimal representations of all integers from 0 to n.
|
|
2
|
|
|
0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 39, 40, 41, 42, 43, 44, 46, 48
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
COMMENTS
|
The total number of digits >= 6 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 2/5)*(2n + 2 - (1/5 + floor(n/10^j + 2/5))*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)*A102677(n) + (1/2)*Sum_{j=1..m+1} ((-1/5*floor(n/10^j + 2/5) + floor(n/10^j))*10^j - (floor(n/10^j + 2/5)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 4*m*10^(m-1).
(this is total number of digits >= 6 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(6*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]>=6 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i), i=0..n), n=0..86); # Emeric Deutsch, Feb 23 2005
|
|
CROSSREFS
|
Cf. A027868, A054899, A055640, A055641, A102669-A102685, A117804, A122840, A122841, A160093, A160094, A196563, A196564. Partial sums of A102669.
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|