login
A102672
Number of digits >= 3 in the decimal representations of all integers from 0 to n.
2
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 30, 32, 34, 36, 38, 39, 40, 41, 43, 45, 47, 49, 51, 53, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 73, 74, 75, 77, 79, 81, 83, 85, 87, 89, 90, 91, 92, 94
OFFSET
0,5
COMMENTS
The total number of digits >= 3 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012
LINKS
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)*A102671(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) = 7*m*10^(m-1).
(This is the total number of digits >= 3 occurring in all the numbers with <= m places.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(3*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]>=3 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i), i=0..n), n=0..80); # Emeric Deutsch, Feb 23 2005
MATHEMATICA
Accumulate[Table[Count[IntegerDigits[n], _?(#>2&)], {n, 0, 80}]] (* Harvey P. Dale, Nov 23 2014 *)
CROSSREFS
Partial sums of A102671.
Cf. A000120, A000788, A023416, A059015 (for base 2).
Sequence in context: A363275 A291567 A132125 * A287643 A114955 A209384
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Feb 03 2005
EXTENSIONS
More terms from Emeric Deutsch, Feb 23 2005
STATUS
approved