Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #14 Mar 05 2020 22:27:55
%S 0,1,0,0,2,0,2,0,3,2,0,0,2,0,2,2,2,0,0,2,0,0,2,2,0,12,0,9,0,3,0,22,3,
%T 0,4,0,0,0,4,3,3,0,3,0,4,0,0,0,3,0,4,3,0,4,3,18,11,0,0,3,0,5,0,4,0,3,
%U 0,0,3,0,3,3,0,0,0,3,5,0,3,0,5,0,3,0
%N Smallest x > 0 such that 10^x - prime(n) is a prime number or 0 if no such prime exists.
%C For p(1) = 2, 10^x - 2 is divisible by 2 for all x > 0 so a(1) = 0.
%C For p(3) = 5, 10^x - 5 is divisible by 5 for all x > 0 so a(3) = 0.
%C For all prime(i) of the form 3*k+1, 10^x-prime(i) is divisible by 3 so a(i) = 0.
%C For n = 913, prime(n) = 7127, if x exists then x > 16000.
%H Pierre CAMI, <a href="/A273846/b273846.txt">Table of n, a(n) for n = 1..912</a>
%e 10^1 - 3 = 7 is prime, so a(2) = 1 as 3 = prime(2).
%e 10^1 - 11 is composite, 10^2 - 11 = 89 is prime, so a(5) = 2 as 11 = prime(5).
%o (PARI) a(n) = if((p=prime(n))%3==1 || n==1 || n==3, 0, for(x=1, oo, if(ispseudoprime(10^x-p), return(x)))); \\ _Jinyuan Wang_, Mar 05 2020
%K nonn
%O 1,5
%A _Pierre CAMI_, Jun 01 2016