login
Least k such that 10^n + k - 1 is the first of a pair of twin primes.
0

%I #19 Feb 06 2024 11:57:34

%S 2,2,20,8,152,38,140,38,8,278,818,62,1268,98,2372,1550,20,620,98,392,

%T 410,650,5528,2732,560,950,428,602,2798,1682,7190,2450,6752,7598,8420,

%U 16880,872,5570,10328,16112,2132,6122,23330,5180,4250,2642,2258,3998,8282,18308,7538,41348

%N Least k such that 10^n + k - 1 is the first of a pair of twin primes.

%t a[n_]:=Take[Select[Range[50000], PrimeQ[10^n+#-1]&&PrimeQ[10^n+#+1]&], 1][[1]]; Table[a[n], {n, 52}] (* _James C. McMahon_, Jan 23 2024 *)

%o (PARI) a(n) = my(k=1); while (!isprime(10^n + k - 1) || !isprime(10^n + k + 1), k++); k; \\ _Michel Marcus_, Jan 24 2024

%K nonn

%O 1,1

%A _Pierre CAMI_, Mar 17 2005

%E Corrected and extended by _Don Reble_, Mar 18 2005

%E a(49)-a(52) from _James C. McMahon_, Jan 27 2024