A256176 Primes formed by concatenating n with n+1 and by concatenating n+2 with n+3.
67, 89, 7879, 8081, 9091, 9293, 186187, 188189, 276277, 278279, 426427, 428429, 438439, 440441, 450451, 452453, 600601, 602603, 606607, 608609, 798799, 800801, 816817, 818819, 858859, 860861, 936937, 938939, 960961, 962963, 11401141, 11421143
Offset: 1
Examples
67, 89 are in the sequence because they are primes and 6, 7, 8, 9 are four consecutive integers. 7879, 8081 are in the sequence because they are primes and 78, 79, 80, 81 are four consecutive integers. 186187, 188189 are in the sequence because they are primes and 186, 187, 188, 189 are four consecutive integers.
Links
- Bui Quang Tuan, Table of n, a(n) for n = 1..100
Programs
-
Mathematica
f[n_] := FromDigits@ Flatten[IntegerDigits /@ Range[n, n + 1]]; {f@ #, f[# + 2]} & /@ Select[Range@ 1200, AllTrue[{f@ #, f[# + 2]}, PrimeQ] &] // Flatten (* Michael De Vlieger, Mar 18 2015 *) fd[{a_,b_}]:=FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]]; Select[ {fd[ Take[#,2]],fd[Take[#,-2]]}&/@Partition[Range[1500],4,1],AllTrue[ #,PrimeQ]&]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 17 2018 *)
-
PARI
lista(nn) = {for (n=1, nn, if (isprime(p=eval(concat(Str(n), Str(n+1)))) && isprime(q=eval(concat(Str(n+2), Str(n+3)))), print1(p, ", ", q, ", ")););} \\ Michel Marcus, Mar 18 2015
Comments