OFFSET
1,6
COMMENTS
Here we put all the digits of prime(n) into a bag and ask how many not necessarily distinct primes can be formed using some or all of these digits.
EXAMPLE
a(35)=6 because from the digits of p(35)=149, six numbers can be formed, 19, 41, 149, 419, 491 & 941, which are primes.
MATHEMATICA
(* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := Length[ Select[ FromDigits /@ Flatten[ Permutations /@ Subsets[ IntegerDigits[ Prime[n]]], 1], PrimeQ[ # ] &] ]; Table[ f[n], {n, 102}] (* Robert G. Wilson v, Feb 10 2005 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Zak Seidov, Jan 29 2005
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Feb 10 2005
Definition clarified by Ray Chandler, Mar 01 2005
STATUS
approved