A004723 Delete all 4's from the sequence of nonnegative integers.
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
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
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
-
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
-
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
Comments