With a fairly minor change (in red, below)
ntubski's test program works fine:
Code:
$ cat greatest
#!/bin/bash
# run this in a new directory
mkdir ./gr
pushd gr &>/dev/null
touch 000{1..8}.mp3
files=(*.mp3)
greatest=$(basename ${files[-1]%.*})
((i=10#$greatest+3))
echo "i = $i, greatest = $greatest"
popd &>/dev/null
rm -rf gr/
$ ./greatest
i = 11, greatest = 0008
<edit>
Of course, adding the 3 is unnecessary if you explicitly set your base to ten...
</edit>