OFFSET
1,2
EXAMPLE
a(5) = 2 as 121 is a multiple of 11.
PROG
(PARI) { a(n) = local(p, c10, z, u, v, l, k, lk, L, q); p=prime(n); c10=Mod(10, p); z=znorder(c10); u=v=Mod(1, p); l=1; k=2; L=List(); while(1, lk=1+log(k+0.1)\log(10); if(k==10^(lk-1), L=List()); if( u*c10^(l+lk)+k*c10^l+v==0, return(k)); q=0; t=[u, v, k%p, l%z]; for(j=1, #L, if(t==L[j], q=1+#L-j)); if(q, k+=((10^lk-1-k)\q)*q; L=List(), listput(L, t)); u=u*c10^lk+k; v+=k*c10^l; l+=lk; k++) } \\ Max Alekseyev, Sep 11 2009
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 01 2002
EXTENSIONS
3 more terms from Erich Friedman, Aug 08 2005
Extended by Max Alekseyev, Sep 11 2009
STATUS
approved