%I #16 May 25 2018 21:59:56
%S 3,3,9,69,129,39,261,213,459,33,57,39,267,657,357,1377,3,387,1899,393,
%T 213,651,3273,2733,3423,1533,429,603,1131,1137,1113,1131,249,603,2979,
%U 159,429,921,1269,2757,777,789,2277,11799,9,5343,1821,6981,23049,1623
%N Least number d such that 10^n -/+ d form a prime pair.
%C a(n)== 0 (mod 3). - _Robert G. Wilson v_, Mar 13 2006
%H Robert Israel, <a href="/A115564/b115564.txt">Table of n, a(n) for n = 1..422</a>
%F a(n) = 3*A117738(n) = A082467(10^n). - _Robert Israel_, May 25 2018
%e a(1)=3 because 10-3=7 and 10+3=13 both of which are primes.
%e a(3)=9 because 1000-9=991 and 1000+9=1009 both of which are primes.
%p f:= proc(n) local k;
%p for k from 3 by 6 do
%p if isprime(10^n+k) and isprime(10^n-k) then return k fi
%p od
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, May 25 2018
%t f[n_] := Block[{k = 1}, While[ ! PrimeQ[10^n - 3k] || ! PrimeQ[10^n + 3k], k++ ]; 3k]; Array[f, 50]
%t dpp[n_]:=Module[{n10=10^n,np=NextPrime[10^n],diff},diff=np-n10; While[ !PrimeQ[n10-diff],np=NextPrime[np];diff=np-n10];np-n10]; Array[dpp,80] (* _Harvey P. Dale_, Mar 28 2012 *)
%o (PARI) { for (n = 1, 80, tenp = 10^n ; p = nextprime(tenp) ; while ( p-tenp < tenp, diff=p-tenp ; if ( isprime(tenp-diff), print1(diff",") ; break ; ) ; p=nextprime(p+1) ; ) ; ) } - _R. J. Mathar_, Mar 15 2006
%Y Cf. A082467, A113213, A117738.
%K nonn
%O 1,1
%A _Lekraj Beedassy_, Mar 11 2006
%E More terms from Craig Baribault (csb166(AT)psu.edu) and _Robert G. Wilson v_, Mar 13 2006
%E More terms from _R. J. Mathar_, Mar 15 2006
%E Corrected by Harvey P. Dale, Mar 28 2012