login
A373794
a(1) = 2; thereafter a(n+1) is the smallest prime not yet in the sequence such that the concatenation a(n) || a(n+1) is prime if n is odd, or composite if n is even.
2
2, 3, 5, 23, 7, 19, 11, 17, 13, 61, 29, 53, 31, 37, 41, 59, 43, 73, 47, 83, 67, 79, 71, 167, 89, 101, 97, 103, 107, 137, 109, 139, 113, 131, 127, 157, 149, 173, 151, 163, 179, 233, 181, 193, 191, 227, 197, 257, 199, 211, 223, 229, 239, 251, 241, 271, 263, 269, 277, 331, 281, 317, 283, 397, 293, 311, 307, 337, 347, 359, 313, 373, 353, 389, 349
OFFSET
1,1
COMMENTS
First differs from A244862 at n = 69.
LINKS
MAPLE
P:=proc(q) local a, k, i, n, t; a:=[2]; for n from 1 to q do k:=1;
if frac(n/2)>0 then t:=1; else t:=0; fi;
for i do k:=nextprime(k); if numboccur(k, a)=0 then if t=1 then
if isprime(a[n]*10^length(k)+k) then a:=[op(a), k]; break; fi;
else if not isprime(a[n]*10^length(k)+k) then a:=[op(a), k]; break;
fi; fi; fi; od; od; print(op(a)); end: P(10^3); # Paolo P. Lava, Jul 03 2024
CROSSREFS
Cf. A244862.
Sequence in context: A013639 A047995 A244862 * A338403 A024782 A024775
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jul 03 2024, based on an email from Paolo P. Lava.
EXTENSIONS
More than the usual number of terms are shown in order to distinguish this from A244862.
STATUS
approved