Cyclotomic polynomial: Difference between revisions

(→‎{{header|jq}}: task2(10))
 
(3 intermediate revisions by the same user not shown)
Line 2,935:
 
=={{header|jq}}==
'''Adapted from the [[#Wren|Wren]] implementation of the Arndt algorithm'''
 
'''Works with jq, the C implementation of jq'''
Line 3,120:
end;
 
{cpIndex:1, summary: {"1": 1}, todo: [range(2;11 $n + 1)]}
| until(.todo|length == 0;
if .cpIndex|is_prime then . else register(.cpIndex) end
| .cpIndex += 1)
| .summary
| (keys | sort_by(tonumber)[]) as $key
| "CP[\(.[$key]|lpad(5))] has a coefficient with magnitude \($key)"
;
Line 3,131:
task1(30),
"",
task2(910)
</syntaxhighlight>
{{output}}
Line 3,177:
CP[ 6545] has a coefficient with magnitude 8
CP[ 6545] has a coefficient with magnitude 9
CP[10465] has a coefficient with magnitude 10
CP[10465] has a coefficient with magnitude 11
CP[10465] has a coefficient with magnitude 12
CP[10465] has a coefficient with magnitude 13
CP[10465] has a coefficient with magnitude 14
</pre>
 
 
=={{header|Julia}}==
2,442

edits