Calculate prefix sums with seq and bc