Calmo numbers: Difference between revisions

Content added Content deleted
(→‎{{header|JavaScript}}: Added a functionally composed variant)
(→‎{{header|JavaScript}}: Added missing "use strict" to the imperative version)
Line 716: Line 716:
=={{header|JavaScript}}==
=={{header|JavaScript}}==
{{Trans|ALGOL 68}}
{{Trans|ALGOL 68}}
Procedural, uses console.log to show the numbers.
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
{ // find some "Calmo" numbers: numbers n such that they have 3k divisors
{ // find some "Calmo" numbers: numbers n such that they have 3k divisors
// (other than 1 and n) for some k > 0 and the sum of their divisors
// (other than 1 and n) for some k > 0 and the sum of their divisors
// taken three at a time is a prime
// taken three at a time is a prime

'use strict'


const maxNumber = 1000 // largest number we will consider
const maxNumber = 1000 // largest number we will consider