OFFSET
2,1
COMMENTS
There is no such 8-digit prime, i.e., the sequence ends at a(7) -- although in theory a(n) might exist for some n > 8. - Hagen von Eitzen, Jun 02 2009
A term must have the last digit coprime to 10 (odd and not divisible by 5), the others from {2, 4, 6, 8}. - David A. Corneth, Aug 28 2023
EXAMPLE
a(4) = 8821:
8 + 821 = 829, which is prime;
88 + 21 = 109, which is prime;
882 + 1 = 883, which is prime;
and no larger 4-digit number has this property.
PROG
(PARI) a(n) = {my(lds = [9, 7, 3, 1], s = (10^n\9-1)*10); forvec(x = vector(n-1, i, [1, 4]), b = s - 20*fromdigits(Vec(x)); for(j = 1, #lds, if(iscan(b + lds[j]), return(b + lds[j])))); -1}
(PARI) iscan(n) = {if(n%3 == 0, return(0)); if(!isprime(n), return(0)); my(l = List(), lp, rp, qd = #digits(n-1)); for(i = 1, qd, rp = n % 10^i; lp = n \ 10^i; if(!isprime(rp + lp), return(0), listput(l, rp + lp))); #Set(l) == qd} \\ David A. Corneth, Aug 28 2023
CROSSREFS
KEYWORD
base,fini,full,nonn
AUTHOR
Ray G. Opao, Mar 23 2005
EXTENSIONS
Last terms a(6) and a(7) from Hagen von Eitzen, Jun 02 2009
STATUS
approved