rahmu wroteVery cool arithma!
I follow a similar approach, but my code is messy, cryptic and looks too much like the draft paper I used to scribble my thoughts down.
Glad to see you writing Python code :)
I really tried hard to understand your technique, but couldn't barge through it. So I decided to implement something and see if they're similar, in order to understand yours.
At any rate, being the sucker I am, I implemented something that doesn't have to recalculate what has already been calculated:
import math
def d(idx, start, n):
idx -= start
ln = len(str(n))
while(idx>=ln):
idx -= ln
n += 1
ln = len(str(n))
s = str(n)
return (int(s[idx]), idx, n)
prd = 1
idx = 1
state = (idx, 0, 1)
for i in range(7):
print state
prd *= state[0]
state = d(idx*10, idx-state[1], state[2])
idx *= 10
print prd