login
Number of digits >= 7 in decimal representation of n.
7

%I #22 Aug 31 2024 19:16:29

%S 0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,

%T 0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,

%U 1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,2,2,2,0,0,0,0,0

%N Number of digits >= 7 in decimal representation of n.

%C a(n) = 0 iff n is in A007093 (numbers in base 7). - _Bernard Schott_, Feb 12 2023

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

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

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

%F G.f.: g(x) = (1/(1-x))*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: seq(p(n),n=0..125); # _Emeric Deutsch_, Feb 23 2005

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

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

%K nonn,base,easy

%O 0,78

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

%E More terms from _Emeric Deutsch_, Feb 23 2005