Anonymous user
Smarandache prime-digital sequence: Difference between revisions
m
→{{header|Haskell}}
Line 666:
smarandache :: [Integer]
smarandache = [2,3,5,7] <> s [2,3,5,7] >>= \x -> guard (isPrime x) >> [x]
where s xs = r <> s r where r = xs >>= \x -> [x*10+2, x*10+3, x*10+5, x*10+7]▼
▲ where r = xs >>= \x -> [x*10+2, x*10+3, x*10+5, x*10+7]
nextSPDSTerms :: [Int] -> [(String, String)]
Line 675 ⟶ 673:
go _ _ [] = []
go c (x:xs) terms
commas :: Show a => a -> String
|