OFFSET
1,1
COMMENTS
a(n) = prime(k) for the least possible k such that prime(i) for k <= i < k+n has the property that it plus its digit sum is prime, but prime(k-1) and prime(k+n) do not have the property.
EXAMPLE
a(3) = 97 because 97, 101, 103 are 3 consecutive primes with 97+9+7 = 113, 101+1+0+1 = 103, 103+1+0+3=107, all prime, but the prime before 97 is 89 and the prime after 103 is 107, and 89+8+9 = 106 and 107+1+0+7 = 115 are not prime; 97 is the least prime for which this works.
MAPLE
N:= 6: # for a(1)..a(N)
V:= Vector(N): count:= 0:
p:= 2: s:= 0:
while count < N do
p:= nextprime(p)
if isprime(p+convert(convert(p, base, 10), `+`)) then
if s = 0 then q:= p fi;
s:= s+1
else
if s >= 1 and s <= N and V[s] = 0 then
V[s]:= q; count:= count+1
fi;
s:= 0
fi
od:
convert(V, list);
MATHEMATICA
seq[len_, pmax_] := Module[{s = Table[0, {len}], v = {}, p = 2, c = 0, pfirst = 2, i}, While[c < len && p < pmax, If[PrimeQ[p + Plus @@ IntegerDigits[p]], AppendTo[v, p]; If[pfirst == 0, pfirst = p], i = Length[v]; v = {}; If[0 < i <= len && s[[i]] == 0, s[[i]] = pfirst]; pfirst = 0]; p = NextPrime[p]]; s]; seq[6, 10^7] (* Amiram Eldar, Aug 14 2022 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
J. M. Bergot and Robert Israel, Aug 12 2022
EXTENSIONS
a(8) from Amiram Eldar, Aug 15 2022
STATUS
approved