(1)
  foo []         = 0
  foo ((x,y):zs) = (if x+y==0 then 1 else 0) + foo zs
(2)
  bar n = [ (i,j) | j <-[1..n], i <- [1..j], i * i <= j ]

(1)
(λ a b c. a b c)(λ x y. x)(λ f x. x) (λ f x. f x)
→ (λ b c. (λ x y. x) b c)(λ f x. x)(λ f x. f x)
→ (λ c. (λ x y. x) (λ f x. x) c)(λ f x. f x)(λ x y. x)(λ f x. x)(λ f x. f x)
→ (λ y f x. x)(λ f x. f x)
→ λ f x. x 
(2)
(λ x y. x (λ u v. u) y)(λ x y. y)(λ x y. x)
→ (λ y. (λ x y. y) (λ u v. u) y)(λ x y. x)(λ x y. y)(λ u v. u)(λ x y. x)
→ (λ y. y)(λ x y. x)
→ λ x y. x 

(1) [(1,0),(2,1),(5,2),(12,5),(29,12),(70,29)]
(2) [(1,2),(3,2),(3,4),(3,6),(5,2),(5,4),(5,6)]