%I #4 Mar 31 2012 13:20:57
%S 1,1,0,1,0,0,0,1,1,1,3,3,2,1,0,0,3,6,8,9,9,35,35,32,26,18,9,0,0,35,70,
%T 102,128,146,155,155,0,0,35,105,207,335,481,636,791,0,0,0,35,140,347,
%U 682,1163,1799,2590,6756,6756,6756,6756,6721,6581,6234,5552,4389,2590,0
%N Triangle read by rows: T(n, k) = number of permutations <p(1), p(2), ..., p(n)> of <1, 2, ..., n> that end with k, such that p(k) > p(k-1) when k is composite and p(k) < p(k-1) when k is prime. (n > 0, 1 <= k <= n).
%F T(1, 1) = 1, T(n, k) = sum(i = k..(n-1), T(n-1, i)) if n is prime, T(n, k) = sum(i = 1..(k-1), T(n-1, i)) if n is composite.
%e T(5, 2) = 3: the 3 permutations are <4,3,1,5,2>, <5,3,1,4,2> and <5,4,1,3,2>.
%Y Cf. A097277.
%K easy,nonn,tabl,less
%O 1,11
%A _David Wasserman_, Aug 05 2004