User TO_CHAR to convert the number into a string then parse the string looking at every 2nd character.
Take the character, convert it to a number with TO_NUMBER, double it, if >10 subtract 9, convert it back to a character with TO_CHAR and place it back in the original string.
SQL isn't necessarily the best language to do this in so if this turns out to be a bottleneck then write an external procedure in C to handle the calculation.