OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
a(5) = 35 is composite with digits 3 and 5 which are primes.
22 is nonprime and has prime digits, twice 2;
573 is nonprime and has prime digits, 3, 5 and 7.
MAPLE
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_neprn0:=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) = 0) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_nepr_neprn0(4000); # Jani Melik, Apr 11 2004
MATHEMATICA
With[{comps=Complement[Range[1000], Prime[Range[PrimePi[1000]]]]}, Select[ comps, And@@PrimeQ[IntegerDigits[#]]&]] (* Harvey P. Dale, Dec 21 2011 *)
Table[Select[FromDigits/@Tuples[{2, 3, 5, 7}, n], CompositeQ], {n, 2, 4}]//Flatten (* Harvey P. Dale, Oct 05 2019 *)
PROG
(Magma) [ n: n in [22..736] | not IsPrime(n) and Set(Intseq(n)) subset [2, 3, 5, 7] ]; // Bruno Berselli, Dec 21 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, May 02 2001
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), May 08 2001
STATUS
approved