Super-d numbers: Difference between revisions

m
No edit summary
Line 239:
import Data.Char (intToDigit)
 
superdisSuperd :: (Show a, Integral a) => a -> a -> Bool
superdisSuperd p n = replicate (fromIntegral p) (intToDigit $ fromIntegral p) `isInfixOf` show (p * n ^ p)
 
findSuperd :: (Show a, Integral a) => a -> [a]
Line 246:
where go [] = []
go (n:ns)
| superdisSuperd p n = n : go ns
| otherwise = go ns
 
main :: IO ()
Line 259:
First 10 super-6 : [27257,272570,302693,323576,364509,502785,513675,537771,676657,678146]
</pre>
 
=={{header|J}}==
<pre>
Anonymous user