login
Least number whose digits can be used to form exactly n different primes (not necessarily using all digits).
8

%I #57 Apr 03 2023 10:36:10

%S 1,2,25,13,37,107,127,113,167,1027,179,137,1036,1127,1013,1137,1235,

%T 1136,1123,1037,1139,1079,10124,10126,1349,1279,1237,3479,10699,1367,

%U 10179,1379,10127,10079,10138,10123,10234,10235,10247,10339,10267

%N Least number whose digits can be used to form exactly n different primes (not necessarily using all digits).

%C Smallest m such that A039993(m) = n. - _M. F. Hasler_, Mar 08 2014

%C Mike Keith conjectures that a(n) always exists and reports that he has checked this for n <= 66. - _N. J. A. Sloane_, Jan 25 2008

%H Michael S. Branicky, <a href="/A076449/b076449.txt">Table of n, a(n) for n = 0..2702</a> (terms 1..457 from Robert G. Wilson v)

%H Michael S. Branicky, <a href="/A076449/a076449.txt">Python program for A076449, A072857, A076730, A134596</a>

%H C. K. Caldwell, The Prime Glossary, <a href="https://t5k.org/glossary/page.php?sort=Primeval">Primeval Number</a>

%H J. P. Delahaye, Primes Hunters, <a href="http://web.archive.org/web/20020901024608/http://www.pour-la-science.com/numeros/pls-258/logique.htm">1379 is very primeval (in French)</a>

%H Mike Keith, <a href="http://www.cadaeic.net/primeval.htm">Integers containing many embedded primes</a>

%H W. Schneider, <a href="http://web.archive.org/web/2004/www.wschnei.de/digit-related-numbers/primeval-numbers.html">Primeval Numbers</a>

%H G. Villemin's Almanach of Numbers, <a href="http://villemin.gerard.free.fr/Wwwgvmm/Premier/primeval.htm">Nombre Primeval de Mike Keith</a>

%F a(n) = min { m | A039993(m)=n } = min A039993^{-1}(n). - _M. F. Hasler_, Mar 08 2014

%e a(10) = 179 because 179 is the least number harboring ten primes (namely 7, 17, 19, 71, 79, 97, 179, 197, 719, 971).

%t (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := Length[ Select[ FromDigits /@ Flatten[ Permutations /@ Subsets[ IntegerDigits[ n]], 1], PrimeQ[ # ] &]]; t = Table[0, {50}]; Do[ a = f[n]; If[a < 50 && t[[a + 1]] == 0, t[[a + 1]] = n], {n, 12500}]; t (* _Robert G. Wilson v_, Feb 12 2005 *)

%o (PARI) A076449(n)=for(m=1,9e9,A039993(m)==n&&return(n)) \\ Not very efficient. - _M. F. Hasler_, Mar 08 2014

%o (Python) # see linked program

%Y Cf. A075053, A072857 gives a similar sequence, A134596.

%K base,nonn

%O 0,2

%A _Lekraj Beedassy_, Nov 07 2002

%E Edited by _Robert G. Wilson v_, Nov 24 2002

%E Keith link repaired by _Charles R Greathouse IV_, Aug 13 2009

%E Definition reworded by _M. F. Hasler_, Mar 08 2014

%E a(26) corrected by _Robert G. Wilson v_, Mar 12 2014