<!-- language-all: lang-hs --> Haskell - 267 bytes (no IO) = p=g(1,0,1,1,3,3)where g(q,r,t,k,n,l)=if 4*q+r-t<n*t then n:g(10*q,10*(r-n*t),t,k,div(10*(3*q+r))t-10*n,l) else g(q*k,(2*q+r)*l,t*l,k+1,div(q*(7*k+2)+r*l)(t*l),l+2) e i s=zipWith(\k c->toEnum$(fromIntegral k)+fromEnum c::Char)(take(length s)$drop(fromIntegral$i-1)p)s `p` is a golfed version of the algorithm that can be found at http://rosettacode.org/wiki/Pi#Haskell `e` is the encoding function : λ> e 2 "house" "isvxn" It does not loop around if an index is outside of the lowercase alphabet. This means that some other characters can slip in the encoded string : "Sfufv#Kork(mq}nns j{i&sv&xitmujtu&vey|h{xljej|35.)(\"%(\"\"&\" %\"\"$()$ ''\"&'!)$'(\"&($(\"& !$'&)]hrs\"ow olih7$Tdkhnsj ns&qpdlw}oplwmxbipn#o{ur!vhbp\"mitj/" Unfortunately, it takes several seconds with offsets greater than `10 000` to compute the output. Bonus - Decoding = d i s=zipWith(\k c->toEnum$fromEnum c-fromIntegral k::Char)(take(length s)$drop(i-1)p)s Again if we test with `isvxn` : λ> d 2 "isvsn" "house"