OFFSET
0,5
EXAMPLE
1 is not a prime,
1 + 3 is not a prime,
1 + 3 + 2 is not a prime,
1 + 3 + 2 + 4 is not a prime.
So [1, 3, 2, 4] satisfies all the conditions.
---------------------------------------------
a(1) = 1: [[1]];
a(3) = 1: [[1, 3, 2]];
a(4) = 3: [[1, 3, 2, 4], [1, 3, 4, 2], [4, 2, 3, 1]];
a(5) = 8: [[1, 3, 2, 4, 5], [1, 3, 4, 2, 5], [1, 5, 2, 4, 3], [1, 5, 4, 2, 3], [4, 2, 3, 1, 5], [4, 2, 3, 5, 1], [4, 5, 1, 2, 3], [4, 5, 3, 2, 1]].
MATHEMATICA
Table[Count[Permutations@ Range@ n, _?(AllTrue[Accumulate@ #, ! PrimeQ@ # &] &)], {n, 0, 10}] (* Michael De Vlieger, Aug 26 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 25 2017
EXTENSIONS
a(0), a(12)-a(23) from Alois P. Heinz, Aug 25 2017
STATUS
approved