OFFSET
1,8
COMMENTS
Leading zeros are not allowed in the rearranged number.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(8) = 2 because 19*23 = 437 and 2 primes, 347 and 743, can be formed from the digits of 437.
MATHEMATICA
nfp[n_]:=With[{id=IntegerDigits[n]}, Length[Select[FromDigits/@Permutations[id], IntegerLength[ #] ==IntegerLength[n]&&PrimeQ[#]&]]]; nfp/@Times@@@Partition[Prime[Range[90]], 2, 1] (* Harvey P. Dale, Aug 29 2024 *)
PROG
(Python)
from sympy import isprime, prime
from sympy.utilities.iterables import multiset_permutations as mp
def c(s):
return sum(1 for t in mp(s) if t[0]!='0' and isprime(int("".join(t))))
def a(n): return c(str(prime(n)*prime(n+1)))
print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Dec 22 2021
CROSSREFS
KEYWORD
AUTHOR
Enoch Haga, Feb 18 2000
EXTENSIONS
Edited by Jens Kruse Andersen, Dec 01 2006
STATUS
approved