Date: Tue, 21 Sep 2010 11:12:11 -0700 From: Jack Brennen PARI program to compute 10,000 terms of A173713 in reasonable time: (For A173065 see below) /* Initialize A : most recent term of sequence V : vector of entire sequence S : set of vector elements and differences */ A=1; V=[1]; S=Set(V); /* Do one iteration: we're looking for N such that A*10^y+N is congruent to 0 modulo A-N Equivalently: A*10^y+A is congruent to 0 modulo A-N So what we do is enumerate all of the divisors of A*(10^y+1), assume each one is equal to A-N or N-A, and choose the smallest N which works */ iterate() = { y=1; while(1,L=10^(y-1);H=10^y;G=A*(10^y+1);D=divisors(G);Z=[]; for(j=1,length(D),W=D[j]; if(A-W>=L&&A-W=L&&A+WA&&T!=U&&