Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Mar 30 2012 18:58:21
%S 0,2,0,0,35,211,0,0,56204,337661,0,0,454113487
%N Number of permutations p of (1,2,3,...,n) such that 1^p(1)+2^p(2)+3^p(3)+...+n^p(n) is prime.
%C a(4*k)=a(4*k+3)=0
%e For n=3: permutations (1,3,2), (3,1,2), (2,3,1), (2,1,3) are OK since 1^1+2^3+3^2=13, 1^3+2^1+3^2=11, 1^2+2^3+3^1=11 and 1^2+2^1+3^3=13, hence a(3)=4.
%e For n=2: both permutations (1,2), (2,1) are OK since 1^1+2^2=5 and 1^2+2^1=3; hence a(2)=2.
%o (PARI) a(n)=sum(k=1,n!,if(isprime(sum(i=1,n,i^component(numtoperm(n,k),i)))-1,0,1))
%K more,nonn
%O 1,2
%A _Benoit Cloitre_, Aug 19 2002
%E a(10) and a(11) from Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 29 2004
%E a(12)-a(13) from _Robert Gerbicz_, Nov 27 2010