$ jq -M -r -n -f hailstone.jq [27|hailstone]|length is 112 The first four numbers: [27,82,41,124] The last four numbers: [8,4,2,1] Maximum length for n|hailstone for n in 1..100000 is 351 (n == 77031)