A232235
Primes that can be written in binary representation as concatenation of two primes: p and p-2. That is, primes representable as p * 2^L + p-2, where p and p-2 are primes, and L is the length of binary representation of p-2: L = A070939(p-2).
Original entry on oeis.org
23, 61, 1021, 139021, 145177, 222127, 2645257, 2706727, 2928019, 3050959, 3997597, 38695537, 45086077, 49903561, 50247667, 53688727, 56294101, 545636617, 556450387, 558023299, 563331877, 563921719, 581616979, 582993277, 607570027, 619956709, 638045197, 660262579
Offset: 1
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.
Original entry on oeis.org
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
269 is in the sequence because the following are three primes: 271, 269 * 512 + 271 = 137999, 271 * 512 + 269 = 139021.
-
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);
}
}
}
-
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 *)
Showing 1-2 of 2 results.
Comments