cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A061371 Composite numbers with all prime digits.

This page as a plain text file.
%I A061371 #24 Jun 30 2025 09:58:07
%S A061371 22,25,27,32,33,35,52,55,57,72,75,77,222,225,232,235,237,252,253,255,
%T A061371 272,273,275,322,323,325,327,332,333,335,352,355,357,372,375,377,522,
%U A061371 525,527,532,533,535,537,552,553,555,572,573,575,722,723,725,732,735
%N A061371 Composite numbers with all prime digits.
%H A061371 T. D. Noe, <a href="/A061371/b061371.txt">Table of n, a(n) for n = 1..1000</a>
%e A061371 35 is composite with digits 3 and 5 which are primes.
%e A061371 22 is composite and has prime digits, twice 2;
%e A061371 573 is composite and has prime digits, 3, 5 and 7.
%p A061371 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:
%p A061371 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:
%p A061371 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
%t A061371 With[{comps=Complement[Range[1000],Prime[Range[PrimePi[1000]]]]}, Select[ comps, And@@PrimeQ[IntegerDigits[#]]&]] (* _Harvey P. Dale_, Dec 21 2011 *)
%t A061371 Table[Select[FromDigits/@Tuples[{2,3,5,7},n],CompositeQ],{n,2,4}]//Flatten (* _Harvey P. Dale_, Oct 05 2019 *)
%o A061371 (Magma) [ n: n in [22..736] | not IsPrime(n) and Set(Intseq(n)) subset [2,3,5,7] ];  // _Bruno Berselli_, Dec 21 2011
%o A061371 (Python)
%o A061371 from sympy import isprime
%o A061371 from itertools import count, islice, product
%o A061371 def agen(): yield from (t for d in count(2) for p in product("2357", repeat=d) if not isprime(t:=int("".join(p))))
%o A061371 print(list(islice(agen(), 54))) # _Michael S. Branicky_, Jun 30 2025
%Y A061371 Cf. A061372.
%K A061371 nonn,base
%O A061371 1,1
%A A061371 _Amarnath Murthy_, May 02 2001
%E A061371 Corrected and extended by Larry Reeves (larryr(AT)acm.org), May 08 2001