Increasing gaps between consecutive Niven numbers: Difference between revisions

Content added Content deleted
Line 221:
import Data.List (intercalate, unfoldr)
import Data.List.Split (chunksOf)
import Data.Tuple (swap)
 
nivens :: [Int]
Line 228 ⟶ 229:
pure n
where
digitSum = sum . unfoldr (\x -> guard (x > 0) >> pure (x `mod`swap 10,$ x `divquotRem` 10))
 
findGaps :: [(Int, Int, Int)]