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 A046810 #18 Feb 17 2024 04:24:32 %S A046810 0,1,1,0,1,0,1,0,0,0,1,0,2,1,0,1,2,0,1,0,0,0,1,0,0,0,0,0,1,0,2,1,0,1, %T A046810 1,0,2,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0, %U A046810 0,0,2,0,2,1,0,1,0,0,2,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,1,0,2,1,0,0,1,0,1,1,0,1,2,0 %N A046810 Number of anagrams of n that are primes. %C A046810 An anagram of a k-digit number is one of the k! permutations of the digits that does not begin with 0. %H A046810 Reinhard Zumkeller, <a href="/A046810/b046810.txt">Table of n, a(n) for n = 1..10000</a> %e A046810 107 has 2 prime anagrams: 107 and 701 (but not 017 or 071); so a(107) = 2. %t A046810 Table[Count[FromDigits/@Select[Permutations[IntegerDigits[n]], First[#] != 0&],_?(PrimeQ[#]&)],{n,110}] (* _Harvey P. Dale_, Aug 24 2011 *) %o A046810 (Haskell) %o A046810 import Data.List (permutations, nub) %o A046810 a046810 n = length $ filter ((== 1) . a010051) %o A046810 $ map read (nub $ filter ((> '0') . head) %o A046810 $ permutations $ show n) %o A046810 -- _Reinhard Zumkeller_, Aug 14 2011 %o A046810 (Python) %o A046810 from sympy import isprime %o A046810 from itertools import permutations %o A046810 def a(n): return len(set(t for p in permutations(str(n)) if p[0]!="0" and isprime(t:=int("".join(p))))) %o A046810 print([a(n) for n in range(1, 106)]) # _Michael S. Branicky_, Feb 17 2024 %Y A046810 Cf. A039999, A055098. %K A046810 nonn,easy,base,nice %O A046810 1,13 %A A046810 _David W. Wilson_