OFFSET
0,3
COMMENTS
Differs from A004179 where A004179(4) = A004179(44) = A004179(444) = ... = 0. - Michel Marcus, May 17 2019
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
MAPLE
f:= proc(n) local L, i;
L:= subs(4=NULL, convert(n, base, 10));
if L = [] then return NULL fi;
add(L[i]*10^(i-1), i=1..nops(L))
end proc:
map(f, [$0..100]); # Robert Israel, May 17 2019
PROG
(MATLAB) m=1;
for u=0:150
v=dec2base(u, 10)-'0'; v = v(v~=4);
if length(v)>0; sol(m)=(str2num(strrep(num2str(v), ' ', ''))); m=m+1; end;
end;
sol % Marius A. Burtea, May 17 2019
(Python)
def A004723(n):
l = len(str(n))
m = 4*(10**l-1)//9
k = n + l - int(n+l < m)
return 3 if k == m else int(str(k).replace('4', '')) # Chai Wah Wu, Apr 20 2021
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved