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 A166921 #27 Feb 15 2021 22:42:01 %S A166921 2,13,113,149,1013,1039,1427,1123,1439,1579,1237,10271,10453,10139, %T A166921 10253,10243,10457,11579,10789,10273,11239,12457,10729,13249,12347, %U A166921 13687,12539,14759,13799,10739,12637,12893,23957,13597,100493,12379,14593,101383,13789 %N A166921 Least prime with exactly n prime anagrams not equal to itself. %C A166921 13 has only one prime anagram (31), and no smaller prime has a prime anagram other than itself, so a(1) = 13. %C A166921 113 has 2 prime anagrams (131 and 311), and no smaller prime has two prime anagrams other than itself, so a(2) = 113. %C A166921 149 has 3 prime anagrams (419, 491, and 941), and no smaller prime has three prime anagrams other than itself, so a(3) = 149. %H A166921 Michael S. Branicky, <a href="/A166921/b166921.txt">Table of n, a(n) for n = 0..2780</a> (terms 83..223 from P. CAMI and Chai Wah Wu, and terms 1..82 from P. CAMI) %H A166921 Michael S. Branicky, <a href="/A166921/a166921.py.txt">Python program</a> %e A166921 a(7) = prime 1123 with 7 prime anagrams 1213, 1231, 1321, 2113, 2131, 2311, 3121. %o A166921 (Python) # see link for faster version %o A166921 from sympy import isprime %o A166921 from itertools import permutations %o A166921 def anagrams(n): %o A166921 s = str(n) %o A166921 return set(int("".join(p)) for p in permutations(s) if p[0] != '0') %o A166921 def num_prime_anagrams(n): return sum(isprime(i) for i in anagrams(n)) %o A166921 def a(n): %o A166921 if n == 0: return 2 %o A166921 k = 3 %o A166921 while not isprime(k) or num_prime_anagrams(k) != n+1: k += 2 %o A166921 return k %o A166921 print([a(n) for n in range(39)]) # _Michael S. Branicky_, Feb 13 2021 %Y A166921 Cf. A039986, A046810. %K A166921 nonn,base %O A166921 0,1 %A A166921 _Pierre CAMI_, Oct 23 2009 %E A166921 Definition edited and a(0) added by _Chai Wah Wu_, Dec 26 2016