OFFSET
0,2
COMMENTS
Possibilities are counted "with repetition", i.e., rolling 2+3 and 3+2 counts as two possibilities. Otherwise said, the probability of getting a prime sum when rolling n six-sided dice, multiplied by 6^n.
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..120
C. Rivera, Puzzle 684 - Primes in N dice.
MATHEMATICA
a[n_] := Block[{pc}, pc[w_] := n! / Times @@ ((Length /@ Split@w)!); Sum[Total[pc /@ IntegerPartitions[p, {n}, Range@6]], {p, Prime@ Range@ PrimePi[6*n]}]]; Array[a, 20] (* _Giovanni Resta_, Apr 06 2013 *)
PROG
(PARI) a(n, s=0)=forvec(v=vector(n, i, [1, 6]), isprime(sum(i=1, n, v[i])) && s++); s \\ Illustrative purpose only, impractical for n>>7.
CROSSREFS
KEYWORD
nonn
AUTHOR
_M. F. Hasler_, Apr 05 2013
EXTENSIONS
a(11)-a(23) from _Giovanni Resta_, Apr 06 2013
STATUS
approved