login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A004723
Delete all 4's from the sequence of nonnegative integers.
9
0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, 35, 36, 37, 38, 39, 0, 1, 2, 3, 5, 6, 7, 8, 9, 50, 51, 52, 53, 5, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 65, 66, 67, 68, 69, 70, 71, 72, 73, 7, 75
OFFSET
0,3
COMMENTS
Differs from A004179 where A004179(4) = A004179(44) = A004179(444) = ... = 0. - Michel Marcus, May 17 2019
LINKS
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
KEYWORD
base,nonn,look
STATUS
approved