A115564 Least number d such that 10^n -/+ d form a prime pair.
3, 3, 9, 69, 129, 39, 261, 213, 459, 33, 57, 39, 267, 657, 357, 1377, 3, 387, 1899, 393, 213, 651, 3273, 2733, 3423, 1533, 429, 603, 1131, 1137, 1113, 1131, 249, 603, 2979, 159, 429, 921, 1269, 2757, 777, 789, 2277, 11799, 9, 5343, 1821, 6981, 23049, 1623
Offset: 1
Examples
a(1)=3 because 10-3=7 and 10+3=13 both of which are primes. a(3)=9 because 1000-9=991 and 1000+9=1009 both of which are primes.
Links
- Robert Israel, Table of n, a(n) for n = 1..422
Programs
-
Maple
f:= proc(n) local k; for k from 3 by 6 do if isprime(10^n+k) and isprime(10^n-k) then return k fi od end proc: map(f, [$1..100]); # Robert Israel, May 25 2018
-
Mathematica
f[n_] := Block[{k = 1}, While[ ! PrimeQ[10^n - 3k] || ! PrimeQ[10^n + 3k], k++ ]; 3k]; Array[f, 50] 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 *)
-
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
Formula
Extensions
More terms from Craig Baribault (csb166(AT)psu.edu) and Robert G. Wilson v, Mar 13 2006
More terms from R. J. Mathar, Mar 15 2006
Corrected by Harvey P. Dale, Mar 28 2012
Comments