%I #12 Jan 03 2016 04:37:22
%S 0,4,4,0,8,4,4,0,0,4,4,9,8,4,4,0,0,4,4,0,8,4,4,9,0,4,4,0,8,4,4,80,9,4,
%T 4,0,8,4,4,63,0,4,4,80,8,4,4,9,0,4,4,45,8,4,4,0,9,4,4,9,8,4,4,0,133,4,
%U 4,80,8,4,4,15,0,4,4,63,8,4,4
%N Least m>0 such that n = y^2 - 9^x (mod m) has no solution, or 0 if no such m exists.
%C To prove that an integer n is in A051211, it is sufficient to find integers x,y such that y^2 - 9^x = n. In that case, a(n)=0. To prove that n is *not* in A051211, it is sufficient to find a modulus m for which the (finite) set of all possible values of 9^x and y^2 (mod m) allows us to deduce that y^2 - 9^x can never equal n. The present sequence lists the smallest such m>0, if it exists.
%e See A200512 for motivation and detailed examples.
%o (PARI) A200519(n,b=9,p=3)={ my( x=0, qr, bx, seen ); for( m=3,9e9, while( x^p < m, issquare(b^x+n) & return(0); x++); qr=vecsort(vector(m,y,y^2-n)%m,,8); seen=0; bx=1; until( bittest(seen+=1<<bx, bx=bx*b%m), for(i=1,#qr, qr[i]<bx & next; qr[i]>bx & break; next(3))); return(m))}
%Y Cf. A051204-A051221, A200505-A200520.
%K nonn
%O 0,2
%A _M. F. Hasler_, Nov 18 2011