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, 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
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A244862.
Programs
-
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
Extensions
More than the usual number of terms are shown in order to distinguish this from A244862.
Comments