OFFSET
1,1
COMMENTS
Is this sequence finite?
Yes, the sequence is finite. The last term is 900 as the previous prime before 900 is 887 and so the first digit of any next term is too small to reach 887. - David A. Corneth, Sep 18 2023
EXAMPLE
a(1) = 4 and 4 - 1 = 3 (prime);
a(2) = 10 and 10 - 8 = 2 (prime);
a(3) = 8 and 8 - 6 = 2 (prime);
a(4) = 6 and 6 - 1 = 5 (prime);
a(5) = 12 and 12 - 9 = 3 (prime); etc.
PROG
(PARI) sequence() = {my(res = List([4]), n = 900, leftover = vector(n, i, 1), proceed = 1); leftover[1] = 0; leftover[4] = 0; forprime(p = 2, n, leftover[p] = 0); while(proceed, for(i = 1, n, if(leftover[i] && isprime(res[#res] - digits(i)[1]), listput(res, i); leftover[i] = 0; next(2))); proceed = 0); res} \\ David A. Corneth, Sep 18 2023
CROSSREFS
KEYWORD
nonn,easy,base,fini,full
AUTHOR
Eric Angelini, Sep 18 2023
EXTENSIONS
More terms from David A. Corneth, Sep 18 2023
STATUS
approved