Numbers whose binary and ternary digit sums are prime: Difference between revisions
Numbers whose binary and ternary digit sums are prime (view source)
Revision as of 22:54, 16 April 2021
, 3 years ago→{{header|Haskell}}
Line 257:
go 0 = 0
go n = uncurry (+) (first go $ quotRem n base)
--------------------------- TEST -------------------------
main :: IO ()
main =
let xs =▼
show (length
>>= \x -> [show x | digitSumsPrime x [2, 3]]▼
<> table xs
▲ in putStrLn $
where
▲ <> " matches in [1..199]\n\n"
[1 ..
------------------------- DISPLAY -----------------------
|