A little more info now . . .
Each time I run this code:
cnt = 0
def seq_num_max(val):
global cnt
if cnt < val:
cnt += 1
else:
cnt = 0
return cnt
The result calculates ALL values to 0, then to 1, then to 2, then 3, then back to 0 again, and so on. Still not sure how to get the repeating values?