Numbers whose binary and ternary digit sums are prime: Difference between revisions

Content added Content deleted
Line 257: Line 257:
go 0 = 0
go 0 = 0
go n = uncurry (+) (first go $ quotRem n base)
go n = uncurry (+) (first go $ quotRem n base)



--------------------------- TEST -------------------------
--------------------------- TEST -------------------------
main :: IO ()
main :: IO ()
main =
main =
putStrLn $
let xs =
[1 .. 199]
show (length xs)
<> " matches in [1..199]\n\n"
>>= \x -> [show x | digitSumsPrime x [2, 3]]
<> table xs
in putStrLn $
where
show (length xs)
xs =
<> " matches in [1..199]\n\n"
<> table xs
[1 .. 199]
>>= \x -> [show x | digitSumsPrime x [2, 3]]


------------------------- DISPLAY -----------------------
------------------------- DISPLAY -----------------------