main :: IO ()
-- x=a+d,y=a,z=a-d
-- (a+d)^2-a^2-(a-d)^2 = n
-- 4ad-a^2=n
-- a(4d-a)=n = xy (say)
-- a=x,d=(x+y)/4
-- a-d>0 ⇒ (3x-y)/4 > 0 ⇒ 3x>y ⇒ n = xy < 3x^2
main =
    print
        . Vector.length
        . Vector.elemIndices 10
        . Vector.unsafeAccum (+) (Vector.replicate (1 + lim) 0)
        $ ([ (n, 1)
           | x <- [1 .. lim]
           , n <- takeWhile (\n -> n < 3 * x * x) [x, 2 * x .. lim]
           , (x + (n `div` x)) `mod` 4 == 0
           ] :: [(Int, Int)]
          )
    where lim = 1000000 :: Int

main :: IO ()
main =
    print
        . Vector.length
        . Vector.elemIndices 10
        . Vector.unsafeAccum (+) (Vector.replicate (1 + lim) 0)
        $ ([ (n, 1)
           | x <- [1 .. lim]
           , n <- takeWhile (\n -> n < 3 * x * x) [x, 2 * x .. lim]
           , (x + (n `div` x)) `mod` 4 == 0
           ] :: [(Int, Int)]
          )
    where lim = 1000000 :: Int
main =
    print
        . Vector.length
        . Vector.elemIndices 10
        . Vector.unsafeAccum (+) (Vector.replicate (1 + lim) 0)
        $ ([ (n, 1)
           | x <- [1 .. lim]
           , n <- takeWhile (\n -> n < 3 * x * x) [x, 2 * x .. lim]
           , (x + (n `div` x)) `mod` 4 == 0
           ] :: [(Int, Int)]
          )
    where lim = 1000000 :: Int