Jump to content

Square but not cube: Difference between revisions

Line 1,453:
'''Works with gojq, the Go implementation of jq'''
<lang jq>
# Emit an unbounded stream
def squares_not_cubes:
def icbrt: pow(10; log10/3) | round;
range(1; infinite)
| (.*.)
| .icbrt as $sqc
| select( (.$c*.$c*.$c) != $sq.);
| icbrt
| select( (.*.*.) != $sq)
| $sq;
limit(30; squares_not_cubes)
Line 1,476 ⟶ 1,475:
1089
</pre>
 
 
 
=={{header|Julia}}==
2,479

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.