login
Composite numbers n such that all digits of n occur in its list of primes.
1

%I #20 Sep 08 2022 08:45:57

%S 95,132,272,312,322,326,333,731,735,912,973,995,1111,1212,1255,1292,

%T 1972,2112,2132,2232,2272,2512,2672,2737,2994,3171,3192,3210,3212,

%U 3243,3315,3393,3792,3933,4172,4341,4371,4383,5150,5192,5271,6973,7132,7210

%N Composite numbers n such that all digits of n occur in its list of primes.

%C For the purpose here, if a number has repeated prime factors, those are written repeatedly. For example, the factorization of 27 is expressed as (3, 3, 3) rather than (3^3). - _Alonso del Arte_, Jul 05 2011

%H Klaus Brockhaus, <a href="/A192180/b192180.txt">Table of n, a(n) for n = 1..10000</a>

%e Since the prime factorization of 95 is (5, 19), and both 9 and 5 occur in (5, 19), the number 95 is on the list.

%e Since the prime factorization of 1255 is (5, 251), and 1, 2, and both 5s occur in (5, 251), the number 1255 is on the list.

%e 22 is not on the list because its prime factorization is (2, 11) and that does not have enough 2s. Nor is 25 on the list because for this sequence we express its factorization as (5, 5) rather than (5^2).

%t Select[Range[2, 5000], Not[PrimeQ[#]] && Sort[DigitCount[FromDigits[Flatten[IntegerDigits/@Flatten[Table[#1, {#2}]&@@@FactorInteger[#]]]]] - DigitCount[#]][[1]] >= 0 &] (* _Alonso del Arte_, Jun 28 2011, based on HomePrimeStep function by _Eric W. Weisstein_ *)

%o (Magma) S:=[]; for n in [1..10000] do if not IsPrime(n) then u:=Intseq(n); f:=Factorization(n); v:=&cat[ [ f[j, 1]: i in [1..f[j, 2]] ]: j in [1..#f] ]; w:=&cat[ Intseq(p): p in v ]; if forall{ a: a in [0..9] | Multiplicity(SequenceToMultiset(u), a) le Multiplicity(SequenceToMultiset(w), a) } then Append(~S, n); end if; end if; end for; S; // _Klaus Brockhaus_, Jul 09 2011

%Y Cf. A037276.

%K nonn,base

%O 1,1

%A _Gil Broussard_, Jun 24 2011