Giuga numbers: Difference between revisions

J
(→‎{{header|Go}}: Now finds the first five, albeit in a very slow time.)
(J)
Line 73:
[30 858 1722 66198 2214408306]
</pre>
 
=={{header|J}}==
 
We can brute force this task building a test for giuga numbers and checking the first hundred thousand integers:
 
<lang J>giguaP=: {{ (1<y)*(-.1 p:y)**/(=<.) y ((_1+%)%]) q: y }}"0</lang>
 
<lang J> 1+I.giguaP 1+i.1e5
30 858 1722 66198</lang>
 
These numbers have some interesting properties but there's an issue with guaranteeing correctness of more sophisticated approaches.
 
=={{header|Julia}}==
6,962

edits