login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A003459 Absolute primes (or permutable primes): every permutation of the digits is a prime.
(Formerly M0658)
46

%I M0658 #111 Jun 18 2023 08:43:34

%S 2,3,5,7,11,13,17,31,37,71,73,79,97,113,131,199,311,337,373,733,919,

%T 991,1111111111111111111,11111111111111111111111

%N Absolute primes (or permutable primes): every permutation of the digits is a prime.

%C From _Bill Gosper_, Jan 24 2003, in a posting to the Math Fun Mailing List: (Start)

%C 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.)

%C To my amazement the (uncompiled, Macsyma) program printed 11,13,...,199,337, and after about a minute, 1111111111111111111!

%C And after a few more minutes, (10^23-1)/9! (End)

%C 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

%C 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

%C See A039986 for a related problem with more sophisticated (PARI) code (iteration over only inequivalent digit permutations). - _M. F. Hasler_, Jul 10 2018

%D Richard C. Schroeppel, personal communication.

%D Wacław Sierpiński, Co wiemy, a czego nie wiemy o liczbach pierwszych. Warsaw: PZWS, 1961, pp. 20-21.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H I. O. Angell and H. J. Godwin, <a href="http://dx.doi.org/10.1090/S0025-5718-1977-0427213-2">On Truncatable Primes</a>, Math. Comput. 31, 265-267, 1977. [Related paper, but primarily concerned with A023107 and A103443. - _N. J. A. Sloane_, Jun 06 2015]

%H T. N. Bhargava and P. H. Doyle, <a href="http://www.jstor.org/stable/2689222">On the existence of absolute primes</a>, Math. Mag., 47 (1974), 233.

%H J. L. Boal and J. H. Bevis, <a href="http://www.jstor.org/stable/2689862">Permutable primes</a>. Math. Mag., 55 (No. 1, 1982), 38-41.

%H C. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=PermutablePrime">The prime glossary: Permutable Prime</a>.

%H J. P. Delahaye, Persistent Primes, <a href="http://www.lifl.fr/~jdelahay/dnalor/ChasseursNbPr.pdf">Illustrating Permutable, Circular, Right & Left Truncatable Primes</a>, Pour La Science no 256.

%H A. W. Johnson, <a href="http://www.jstor.org/stable/2689738">Absolute primes</a>, Mathematics Magazine, 1977, vol. 50, pp. 100-103.

%H R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>.

%H W. Schneider, MATHEWS, <a href="http://web.archive.org/web/2004/www.wschnei.de/digit-related-numbers/circular-primes.html">Circular, Permutable, Truncatable and Deletable Primes</a>.

%H A. Slinko, <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.23.13&amp;rep=rep1&amp;type=pdf">Absolute Primes</a> Oct. 2000.

%H A. Slinko, <a href="/A003459/a003459.pdf">Absolute Primes</a>, Oct. 2000 [Cached copy, permission requested].

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Permutable_prime">Permutable prime</a>.

%H <a href="/index/Tri#tprime">Index entries for sequences related to truncatable primes</a>.

%F Conjecture: for n >= 23, a(n) = A004022(n-21). - _Max Alekseyev_, Oct 08 2018

%t 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 *)

%t (* Linear complexity: can't reach R(19). See A258706. - _Bill Gosper_, Jan 06 2017 *)

%o (Haskell)

%o import Data.List (permutations)

%o a003459 n = a003459_list !! (n-1)

%o a003459_list = filter isAbsPrime a000040_list where

%o isAbsPrime = all (== 1) . map (a010051 . read) . permutations . show

%o -- _Reinhard Zumkeller_, Sep 15 2011

%o (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

%Y Includes all of A004022 = A002275(A004023).

%Y A258706 gives minimal representatives of the permutation classes.

%Y Cf. A010051, A023107, A016114, A103443, A129338, A141263.

%Y Cf. A039986.

%K nonn,base,nice,hard

%O 1,1

%A _N. J. A. Sloane_

%E The next terms are a(25)=A002275(317), a(26)=A002275(1031), a(27)=A002275(49081).

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)