RosettaCodeData/Task/Generator-Exponential/Jq/generator-exponential-3.jq
2017-09-25 22:28:19 +02:00

5 lines
227 B
Text

# Generate the first 4 values in the sequence i^2:
[0,0] | emit(4; next_power(2)) | .[1]
# Generate all the values in the sequence i^3 less than 100:
[0,0] | recurse(next_power(3) | if .[1] < 100 then . else empty end) | .[1]