Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 335 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 335 Bytes

Enumeration of pairs of naturals

Write a function with type

enum_nat_nat : int -> int * int

which maps each natural number to a pair of naturals, producing the following enumeration:

(0, 0) (0, 1) (1, 0) (0, 2) (1, 1) (2, 0) (0, 3) (1, 2) (2, 1) (3, 0) (0, 4) (1, 3) (2, 2) (3, 1) (4, 0) (0, 5) ...