import Data.List
import Number
import Data.Maybe
spiral' s = take 4.tail.iterate (+s)
spiral = [1]:[spiral' ((+1).floor.sqrt.fromIntegral$i)i|i<-map last spiral]
p058 =g.floor.fst.fromJust.find((<0.1).uncurry (flip (/))).tail. zip [realToFrac$1+4*n|n<-[..]] .scanl1 (+).map (realToFrac.length.filter isPrime)$spiral
where g a = div (a-1) 2 + 1
main = print p058

なんかすごく長くなった。