Semiprime: Difference between revisions
→{{header|jq}}: simplify
m (→{{header|Lambdatalk}}: minor edit) |
(→{{header|jq}}: simplify) |
||
Line 1,357:
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
<syntaxhighlight lang="jq">
| if (. % $i) == 0 ▼
| if $i == $r then $i else $i, $r end▼
else empty▼
end;▼
def is_semiprime:
| until( .i > .n or .result;
if .nf == 2 then .result = 0
| .n /= .i
</syntaxhighlight>
'''Examples'''
|