In actual Haskell I would write it as
sum [ n^2 | n <- [1..5], n % 3 == 1 ]
which seems to express the idea fairly directly and I'm fairly sure has a close analog in python.