%I #5 Mar 31 2012 14:40:00
%S 100,104,106,108,110,111,114,116,118,119,140,141,144,146,148,160,161,
%T 164,166,168,169,180,184,186,188,189,190,194,196,198,400,404,406,408,
%U 410,411,414,416,418,440,441,444,446,448,460,464,466,468,469,480,481
%N Nonprime numbers with exactly three nonprime digits.
%e 100 is nonprime and has three nonprime digits, twice 0 and 1;
%e 961 is nonprime and has three nonprime digits, 1, 6 and 9.
%p stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stnepf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='false') then stpf:=stpf+1; # number of nonprime digits fi od; RETURN(stpf) end: ts_nepr_neprnt:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( isprime(i)='false' and ts_stnepf(i) = 3) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_nepr_neprnt(1000);
%K nonn,base
%O 1,1
%A _Jani Melik_, Apr 11 2004