Giuga numbers: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
Line 384: Line 384:


=={{header|Julia}}==
=={{header|Julia}}==
<syntaxhighlight lang="ruby">using Primes
<syntaxhighlight lang="julia">using Primes


isGiuga(n) = all(f -> f != n && rem(n ÷ f - 1, f) == 0, factor(Vector, n))
isGiuga(n) = all(f -> f != n && rem(n ÷ f - 1, f) == 0, factor(Vector, n))
Line 407: Line 407:
</pre>
</pre>
=== Ad hoc faster version ===
=== Ad hoc faster version ===
<syntaxhighlight lang="ruby">using Primes
<syntaxhighlight lang="julia">using Primes


function getgiugas(numberwanted, verbose = true)
function getgiugas(numberwanted, verbose = true)