Ruby 1.9, 52 46 (42) characters
eval"A,B="+gets;i=0;p eval"(A-B+i+=1)/i*"*B+?1 If stderr is ignored:
eval"A,B=I="+gets;p eval"I/(A-I-=1)*"*B+?1 Ruby 1.8, 43 characters, no additional output to stderr:
eval"a,b=i="+gets;p eval"i/(a-i-=1)*"*b+"1" Edits:
- (52 -> 48) Found a shorter way to parse the input
- (48 -> 46) Less looping, more eval.