OFFSET
1,1
COMMENTS
All terms are congruent to 5 (mod 6).
Records: 5, 29, 119, 413, 809, 1511, 2033, 2261, 5003, 5879, 26801, ..., 37058441, ... - Robert G. Wilson v, Dec 10 2019
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1250
EXAMPLE
a(1) = 5 because the greatest twin prime pair less than 10 is {5, 7};
a(2) = 29 since the greatest 2-digit twin prime pair is {71, 73};
a(3) = 119 since the greatest 3-digit twin prime pair is {881, 883}; etc.
MAPLE
f:= proc(n) local w, p, q;
w:= 10^n; q:= w;
do
p:= q;
q:= prevprime(p);
if p-q = 2 then return w-q fi;
od
end proc:
map(f, [$1..100]); # Robert Israel, Nov 28 2019
MATHEMATICA
p[n_] := Block[{d = PowerMod[10, n, 6]}, 10^n - NestWhile[# -6 &, 10^n -d -1, !PrimeQ[#] || !PrimeQ[# +2] &]]; Array[p, 50] (* updated Nov 29 2019 *)
PROG
(PARI) prectwin(n)=n++; while(!isprime(2+n=precprime(n-1)), ); n
a(n)=10^n - prectwin(10^n) \\ Charles R Greathouse IV, Nov 28 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Nov 28 2019
STATUS
approved