a=37*3^3 t=0 n={} for r=2,7 do t=3*t+1 d = t repeat for i = 1,t do n[d+i]=1 end d=d+3^r until d>a end for i=0,a do if n[i]==nil then print(i) end end