Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,18 @@
import Data.List (intercalate)
import Data.Maybe (maybe)
import Safe (headMay)
maybeBabbage :: Integer -> Maybe Integer
maybeBabbage upperLimit =
headMay
(filter ((269696 ==) . flip rem 1000000) ((^ 2) <$> [1 .. upperLimit]))
main :: IO ()
main = do
let upperLimit = 100000
putStrLn $
maybe
(intercalate (show upperLimit) ["No such number found below ", " ..."])
(intercalate " ^ 2 -> " .
fmap show . (<*>) [floor . sqrt . fromInteger, id] . pure)
(maybeBabbage upperLimit)