-- verified for 1<=n<=9
test2 n =
  let ts = allcNPTnb True n in
  let a000139' n = if n == 0 then 1 else
                     2*fact (3*n) `div` (fact (2*n+1) * fact(n+1)) in
  let nsts =
        [t | t <- ts, flip all (t:subnormal_subnormals t) $ \t' ->
          let (xs,u) = unlambdas t' in
          length xs <= 1 + length (snd (unapps u []))] in
  toInteger (length nsts) == a000139' (toInteger (n-1))
test2 n =
  let ts = allcNPTnb True n in
  let a000139' n = if n == 0 then 1 else
                     2*fact (3*n) `div` (fact (2*n+1) * fact(n+1)) in
  let nsts =
        [t | t <- ts, flip all (t:subnormal_subnormals t) $ \t' ->
          let (xs,u) = unlambdas t' in
          length xs <= 1 + length (snd (unapps u []))] in
  toInteger (length nsts) == a000139' (toInteger (n-1))
test2 n =
  let ts = allcNPTnb True n in
  let a000139' n = if n == 0 then 1 else
                     2*fact (3*n) `div` (fact (2*n+1) * fact(n+1)) in
  let nsts =
        [t | t <- ts, flip all (t:subnormal_subnormals t) $ \t' ->
          let (xs,u) = unlambdas t' in
          length xs <= 1 + length (snd (unapps u []))] in
  toInteger (length nsts) == a000139' (toInteger (n-1))