|
|
A003459
|
|
Absolute primes (or permutable primes): every permutation of the digits is a prime.
(Formerly M0658)
|
|
46
|
|
|
2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 199, 311, 337, 373, 733, 919, 991, 1111111111111111111, 11111111111111111111111
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
From Bill Gosper, Jan 24 2003, in a posting to the Math Fun Mailing List: (Start)
Recall Sloane's old request for more terms of A003459 = (2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 199 311 337 373 733 919 991 ...) and Richard C. Schroeppel's astonishing observation that the next term is 1111111111111111111. Absent Rich's analysis, trying to extend this sequence makes a great set of beginner's programming exercises. We may restrict the search to combinations of the four digits 1,3,7,9, only look at starting numbers with nondecreasing digits, generate only unique digit combinations, and only as needed. (We get the target sequence afterward by generating and merging the various permutations, and fudging the initial 2,3,5,7.)
To my amazement the (uncompiled, Macsyma) program printed 11,13,...,199,337, and after about a minute, 1111111111111111111!
And after a few more minutes, (10^23-1)/9! (End)
Boal and Bevis say that Johnson (1977) proves that if there is a term > 1000 with exactly two distinct digits then it must have more than nine billion digits. - N. J. A. Sloane, Jun 06 2015
Some authors require permutable or absolute primes to have at least two different digits. This produces the subsequence A129338. - M. F. Hasler, Mar 26 2008
See A039986 for a related problem with more sophisticated (PARI) code (iteration over only inequivalent digit permutations). - M. F. Hasler, Jul 10 2018
|
|
REFERENCES
|
Richard C. Schroeppel, personal communication.
Wacław Sierpiński, Co wiemy, a czego nie wiemy o liczbach pierwszych. Warsaw: PZWS, 1961, pp. 20-21.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
A. W. Johnson, Absolute primes, Mathematics Magazine, 1977, vol. 50, pp. 100-103.
|
|
FORMULA
|
|
|
MATHEMATICA
|
f[n_]:=Module[{b=Permutations[IntegerDigits[n]], q=1}, Do[If[!PrimeQ[c=FromDigits[b[[m]]]], q=0; Break[]], {m, Length[b]}]; q]; Select[Range[1000], f[#]>0&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2011 *)
|
|
PROG
|
(Haskell)
import Data.List (permutations)
a003459 n = a003459_list !! (n-1)
a003459_list = filter isAbsPrime a000040_list where
isAbsPrime = all (== 1) . map (a010051 . read) . permutations . show
(PARI) for(n=1, oo, my(S=[], r=10^n\9); for(a=1, 9^(n>1), for(b=if(n>2, 1-a), 9-a, for(j=0, if(b, n-1), ispseudoprime(a*r+b*10^j)||next(2)); S=concat(S, vector(if(b, n, 1), k, a*r+10^(k-1)*b)))); apply(t->printf(t", "), Set(S))) \\ M. F. Hasler, Jun 26 2018
|
|
CROSSREFS
|
A258706 gives minimal representatives of the permutation classes.
|
|
KEYWORD
|
nonn,base,nice,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|