##Consider seq
Consider seq
Using seq makes your code significantly shorter in those for loops since you can just rely on seq to do your limit checking and the increments. beware that seq is non-standard though.
for (( i = 0; i <= $limit; i+=$1 )); do
could simply be written as:
for i in $(seq 0 $i $limit) do
thanks to janos for pointing out the grievous flaws in the previous version of my answer
##To Space or not to space?
To Space or not to space?
Compare your spacing in that for loop header:
for (( i = 0; i <= $limit; i+=$1 )); do
stick to either always adding spaces around operators or not doing it at all. I recommend the former. This makes for a significant readability improvement, especially when not having syntax highlighting or similar.
I'm sure there's more, but that's about the whole extent of my bash knowledge, so I leave the rest in the hands of more competent reviewers :)