A232239 Lesser of twin-bin primes: primes p such that p+2, x and y are primes, where x is concatenation of binary representations of p and p+2, and y is concatenation of binary representations of p+2 and p: x = p * 2^A070939(p+2) + p+2, y = (p+2) * 2^A070939(p) + p.
3, 5, 269, 16649, 27689, 29129, 82889, 93239, 129629, 274199, 289169, 309479, 336899, 349079, 371339, 374639, 415109, 454709, 463889, 492719, 1051079, 1063919, 1127309, 1198289, 1209779, 1229519, 1268789, 1350959, 1354649, 1355279, 1392539, 1430879, 1547129, 1551959
Offset: 1
Examples
269 is in the sequence because the following are three primes: 271, 269 * 512 + 271 = 137999, 271 * 512 + 269 = 139021.
Programs
-
Java
import java.math.BigInteger; public class A232239 { public static void main (String[] args) { long bl = 2, next = 3; // bit length, next n such that bl++ for n + 2 for (long n = 3; n < 0xffffffffL; n += 2) { long blPrev = bl; if (n == next) { ++bl; next = next * 2 + 1; } if (BigInteger.valueOf(n).isProbablePrime(80) && BigInteger.valueOf(n + 2).isProbablePrime(80) && BigInteger.valueOf((n << bl) + n + 2).isProbablePrime(80) && BigInteger.valueOf(((n + 2) << blPrev) + n).isProbablePrime(80)) System.out.printf("%d, ", n); } } }
-
Mathematica
Select[Prime[Range[200]], PrimeQ[# + 2] && PrimeQ[FromDigits[Flatten[{IntegerDigits[#, 2], IntegerDigits[# + 2, 2]}], 2]] && PrimeQ[FromDigits[Flatten[{IntegerDigits[# + 2, 2], IntegerDigits[#, 2]}], 2]] &] (* Alonso del Arte, Jan 19 2014 *)
Comments