Function dependence on iteration variable of another function
This largely depends on your use case. If there are situations that call for only calculating based off of certain values or subsets of values, then the second version should be preferred, but if you are always going be calculating all values, then the first should be preferred.