login
A365768
Lexicographically earliest permutation of the prime numbers such that a(n) + [the next digit] is a composite.
3
2, 7, 3, 5, 11, 13, 17, 19, 23, 29, 31, 37, 53, 41, 43, 59, 47, 71, 61, 73, 79, 67, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 307, 229, 233, 239, 311, 313, 241, 251, 257, 263
OFFSET
1,1
COMMENTS
Is this sequence finite?
EXAMPLE
a(1) = 2 and 2 + 7 = 9 (composite);
a(2) = 7 and 7 + 3 = 10 (composite);
a(3) = 3 and 3 + 5 = 8 (composite);
a(4) = 5 and 5 + 1 = 6 (composite);
a(5) = 11 and 11 + 1 = 12 (composite); etc.
PROG
(PARI) upto(n) = {my(res = List([2]), leftover = vector(n), proceed = 1); forprime(p = 3, n, leftover[p] = 1); while(proceed, forprime(i = 2, 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 19 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Sep 18 2023
EXTENSIONS
More terms from David A. Corneth, Sep 19 2023
STATUS
approved