OFFSET
0,45
COMMENTS
a(n) = 0 iff n is in A007090 (numbers in base 4). - Bernard Schott, Feb 01 2023
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 0..10000
FORMULA
From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 3/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(4*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]>=4 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n), n=0..125); # Emeric Deutsch, Feb 22 2005
MATHEMATICA
Table[Total@ Take[DigitCount@ n, {4, 9}], {n, 0, 104}] (* Michael De Vlieger, Aug 17 2017 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Feb 03 2005
EXTENSIONS
More terms from Emeric Deutsch, Feb 22 2005
STATUS
approved