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.
%I A003459 M0658 #119 Jul 15 2025 11:36:08 %S A003459 2,3,5,7,11,13,17,31,37,71,73,79,97,113,131,199,311,337,373,733,919, %T A003459 991,1111111111111111111,11111111111111111111111 %N A003459 Absolute primes (or permutable primes): every permutation of the digits is a prime. %C A003459 From _Bill Gosper_, Jan 24 2003, in a posting to the Math Fun Mailing List: (Start) %C A003459 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 A003459 To my amazement the (uncompiled, Macsyma) program printed 11,13,...,199,337, and after about a minute, 1111111111111111111! %C A003459 And after a few more minutes, (10^23-1)/9! (End) %C A003459 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 A003459 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 A003459 See A039986 for a related problem with more sophisticated (PARI) code (iteration over only inequivalent digit permutations). - _M. F. Hasler_, Jul 10 2018 %D A003459 Richard C. Schroeppel, personal communication. %D A003459 Wacław Sierpiński, Co wiemy, a czego nie wiemy o liczbach pierwszych. Warsaw: PZWS, 1961, pp. 20-21. %D A003459 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A003459 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113. %H A003459 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 A003459 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 A003459 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 A003459 C. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=PermutablePrime">The prime glossary: Permutable Prime</a>. %H A003459 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 A003459 James Grime and Brady Haran, <a href="https://www.youtube.com/watch?v=cmJ18ViCUAI">Absolute Primes</a>, YouTube Numberphile video, 2024. %H A003459 A. W. Johnson, <a href="http://www.jstor.org/stable/2689738">Absolute primes</a>, Mathematics Magazine, 1977, vol. 50, pp. 100-103. %H A003459 R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>. %H A003459 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 A003459 A. Slinko, <a href="https://citeseerx.ist.psu.edu/pdf/5ed85bf633b3fb4f40c34b885202c04501144bbb">Absolute Primes</a> Oct. 2000. %H A003459 A. Slinko, <a href="/A003459/a003459.pdf">Absolute Primes</a>, Oct. 2000 [Cached copy, permission requested]. %H A003459 Wikipedia, <a href="http://en.wikipedia.org/wiki/Permutable_prime">Permutable prime</a>. %H A003459 <a href="/index/Tri#tprime">Index entries for sequences related to truncatable primes</a>. %F A003459 Conjecture: for n >= 23, a(n) = A004022(n-21). - _Max Alekseyev_, Oct 08 2018 %t A003459 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 A003459 (* Linear complexity: can't reach R(19). See A258706. - _Bill Gosper_, Jan 06 2017 *) %o A003459 (Haskell) %o A003459 import Data.List (permutations) %o A003459 a003459 n = a003459_list !! (n-1) %o A003459 a003459_list = filter isAbsPrime a000040_list where %o A003459 isAbsPrime = all (== 1) . map (a010051 . read) . permutations . show %o A003459 -- _Reinhard Zumkeller_, Sep 15 2011 %o A003459 (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 A003459 Includes all of A004022 = A002275(A004023). %Y A003459 A258706 gives minimal representatives of the permutation classes. %Y A003459 Cf. A010051, A023107, A016114, A103443, A129338, A141263. %Y A003459 Cf. A039986. %K A003459 nonn,base,nice,hard %O A003459 1,1 %A A003459 _N. J. A. Sloane_ %E A003459 The next terms are a(25)=A002275(317), a(26)=A002275(1031), a(27)=A002275(49081).