primes :: (Integral a) => [a]
primes = 2 : ([3, 5 ..] & filter (not . has_divisor))
 where
  has_divisor n =
    any ((0 ==) . (n `mod`) . fst) $ takeWhile ((n >=) . snd) primes_with_square
  primes_with_square :: (Integral a) => [(a, a)]
  primes_with_square = [(p, p * p) | p <- primes]

euler project 문제 풀다가..

1

❤️

1 person reacted.

Hi, I'm who's behind Fedify, Hollo, BotKit, and this website, Hackers' Pub! My main account is at @hongminhee洪 民憙 (Hong Minhee) :nonbinary:.

Fedify, Hollo, BotKit, 그리고 보고 계신 이 사이트 Hackers' Pub을 만들고 있습니다. 제 메인 계정은: @hongminhee洪 民憙 (Hong Minhee) :nonbinary:.

FedifyHolloBotKit、そしてこのサイト、Hackers' Pubを作っています。私のメインアカウントは「@hongminhee洪 民憙 (Hong Minhee) :nonbinary:」に。