OFFSET
1,3
LINKS
K. Gaitanas, Avoiding multiples of p, MathOverflow.
FORMULA
For n>1, a(n) = A232663(n) / (n-1-(n mod 2)).
EXAMPLE
For n=5, the permutation (1,2,4,3) has proper partial sums 1, 1+2=3, 1+2+4=7, neither of which is zero modulo n. The number of such permutations is a(5)=16.
PROG
(PARI) { a(n) = my(r=0, q, s, g); for(i=1, (n-1)!, q=numtoperm(n-1, i); s=Mod(0, n); g=1; for(j=1, n-2, s+=q[j]; if(s==0, g=0; break)); r+=g); r }
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Max Alekseyev, Nov 27 2013
STATUS
approved