Calmo numbers: Difference between revisions
→{{header|JavaScript}}: Added missing "use strict" to the imperative version
(→{{header|JavaScript}}: Added a functionally composed variant) |
(→{{header|JavaScript}}: Added missing "use strict" to the imperative version) |
||
Line 716:
=={{header|JavaScript}}==
{{Trans|ALGOL 68}}
Procedural, uses console.log to show the numbers.
<syntaxhighlight lang="javascript">
{ // 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
// taken three at a time is a prime
'use strict'
const maxNumber = 1000 // largest number we will consider
|