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 A075053 #46 Sep 13 2022 11:14:38 %S A075053 0,0,1,1,0,1,0,1,0,0,0,1,1,3,1,1,1,3,0,1,1,1,2,3,1,2,1,2,1,2,1,3,3,2, %T A075053 2,3,1,4,2,1,0,1,1,2,0,1,0,2,0,0,1,1,2,3,1,2,1,2,1,2,0,1,1,1,0,1,0,2, %U A075053 0,0,1,3,2,4,2,2,2,2,1,3,0,0,1,2,0,1,0,1,0,1,0,1,2,1,0,2,0,3,1,0,0,2,1,4,2 %N A075053 Number of primes (counted with repetition) that can be formed by rearranging some or all of the digits of n. %C A075053 "Counted with repetition" means that if the same prime can be obtained using different digits, then it is counted several times (e.g., 13 obtained from 113 using the 1st and 3rd digit or the 2nd and 3rd digit), but not so if it is obtained as different permutations of the same digits (e.g., a(11) = 1 because the identical permutation and the transposition (2,1) of the digits [1,1] both yield 11, but this does not count twice since the same digits are used). - _M. F. Hasler_, Mar 12 2014 %C A075053 See A039993 for the variant which counts only distinct primes, e.g., A039993(22) = 1, A039993(113) = 7. See A039999 for the variant which requires all digits to be used. - _M. F. Hasler_, Oct 14 2019 %H A075053 T. D. Noe, <a href="/A075053/b075053.txt">Table of n, a(n) for n = 0..10000</a> %H A075053 M. F. Hasler, <a href="https://oeis.org/wiki/Primeval_numbers">Primeval numbers</a>, OEIS wiki, 2014, updated 2019. %F A075053 a(n) >= A039993(n) with equality iff n has no duplicate digit. - _M. F. Hasler_, Oct 14 2019 %F A075053 a(n) = Sum_{k in S(n)} A039999(k), if n has not more than one digit 0, where S(n) are the numbers whose nonzero digits are a subsequence of those of n, and which contain the digit 0 if n does, taken with multiplicity (for numbers using some but not all digits that are repeated in n). - _M. F. Hasler_, Oct 15 2019 %e A075053 From 13 we can obtain 3, 13 and 31 so a(13) = 3. In the same way, a(17) = 3. %e A075053 From 22 we obtain 2 in two ways, so a(22) = 2. %e A075053 a(101) = 2 because from the digits of 101 one can form the primes 11 (using digits 1 & 3) and 101 (using all digits). The prime 11 = 011 formed using all 3 digits does not count separately because it has a leading zero. %e A075053 a(111) = 3 because one can form the prime 11 using digits 1 & 2, 1 & 3 or 2 & 3. %t A075053 f[n_] := Length@ Select[ Union[ FromDigits@# & /@ Flatten[ Subsets@# & /@ Permutations@ IntegerDigits@ n, 1]], PrimeQ@# &]; Array[f, 105, 0] (* _Robert G. Wilson v_, Mar 12 2014 *) %o A075053 (PARI) A075053(n,D=vecsort(digits(n)),S=0)=for(b=1,2^#D-1,forperm(vecextract(D,b),p,p[1]&&isprime(fromdigits(Vec(p)))&&S++));S \\ Second optional arg allows to give the digits if they are already known. - _M. F. Hasler_, Oct 14 2019, replacing earlier code from 2014. %o A075053 (Python) %o A075053 from itertools import combinations %o A075053 from sympy.utilities.iterables import multiset_permutations %o A075053 from sympy import isprime %o A075053 def A075053(n): return sum(1 for l in range(1,len(str(n))+1) for a in combinations(str(n),r=l) for b in multiset_permutations(a) if b[0] !='0' and isprime(int(''.join(b)))) # _Chai Wah Wu_, Sep 13 2022 %Y A075053 Different from A039993 (counts only distinct primes). Cf. A072857, A076449. %Y A075053 Cf. A039999 (use all digits, count only distinct primes, allow leading zeros), A046810 (similar but don't allow leading zeros). %Y A075053 Cf. A134597 (maximum over all n-digit numbers), A076730 (maximum of A039993 for all n-digit numbers). %Y A075053 Cf. A239196 and A239197 for record indices and values. %K A075053 nonn,base,easy %O A075053 0,14 %A A075053 _N. J. A. Sloane_, Oct 12 2002 %E A075053 Corrected and extended by _John W. Layman_, Oct 15 2002 %E A075053 Examples & crossrefs edited by _M. F. Hasler_, Oct 14 2019