OFFSET
0,1
COMMENTS
Equivalently, least k > 0 such that either 10^n + k + {0, 2, 6} or 10^n + k + {0, 4, 6} are primes.
The initial term, index n = 0, is the only even term and the only case where the last member of the triplet has one digit more than the first member. The value a(0) = 4 correspond to the prime triplet (5, 7, 11). We do not consider the triplets (2, 3, 5) or (3, 5, 7) which come earlier but do not follow the standard pattern.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..216
Norman Luhn, smallest 7000 digit prime triplet, primenumberstheory mailing list at groups.io, Sep 14 2022
FORMULA
a(n) = min{ k>0 | 10^n + k + [0, 6] contains 3 primes }.
a(n) = min A007529 ∩ [10^n, oo) for n > 0.
EXAMPLE
(11, 13, 17) and (101, 103, 107) are the smallest 2-digit and 3-digit prime triplets, at distance a(1) = a(2) = 1 from 10^1 and 10^2, respectively.
(1087, 1091, 1093) is the smallest 4-digit prime triplet, at distance a(3) = 87 from 10^3.
a(6999) = 1141791245437 is the distance from 10^6999 to the smallest 7000 digit prime triplet, of the form (p, p+2, p+6).
MAPLE
f:= proc(n) local p;
for p from 10^n + 1 by 2 do
if p mod 3 = 1 then if isprime(p) and isprime(p+4) and isprime(p+6) then return p-10^n fi
elif p mod 3 = 2 and isprime(p) and isprime(p+2) and isprime(p+6) then
return p-10^n
fi
od;
end proc:
f(0):= 4:
map(f, [$0..45]); # Robert Israel, Sep 15 2022
A357052 := proc(n) local p, q, r; p, q, r := 10^n, 0, 0; while p-r <> 6 do p, q, r := nextprime(p+1), p, q; od; r-10^n; end; # M. F. Hasler, Sep 15 2022
PROG
(PARI) A357052(n, q=-9, r=-9)=forprime(p=10^n, , p-r<7 && return(r-10^n); [q, r]=[p, q])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Sep 14 2022
STATUS
approved