Numbers whose binary and ternary digit sums are prime: Difference between revisions
Content added Content deleted
(Added Quackery.) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,861: | Line 1,861: | ||
{{libheader|Wren-math}} |
{{libheader|Wren-math}} |
||
{{libheader|Wren-fmt}} |
{{libheader|Wren-fmt}} |
||
{{libheader|Wren-seq}} |
|||
<syntaxhighlight lang="ecmascript">import "/math" for Int |
<syntaxhighlight lang="ecmascript">import "/math" for Int |
||
import "/fmt" for Fmt |
import "/fmt" for Fmt |
||
import "/seq" for Lst |
|||
var numbers = [] |
var numbers = [] |
||
Line 1,875: | Line 1,873: | ||
} |
} |
||
System.print("Numbers < 200 whose binary and ternary digit sums are prime:") |
System.print("Numbers < 200 whose binary and ternary digit sums are prime:") |
||
Fmt.tprint("$4d", numbers, 14) |
|||
for (chunk in Lst.chunks(numbers, 14)) Fmt.print("$4d", chunk) |
|||
System.print("\nFound %(numbers.count) such numbers.")</syntaxhighlight> |
System.print("\nFound %(numbers.count) such numbers.")</syntaxhighlight> |
||