A100724 Prime numbers whose binary representations are split into at most 3 runs.
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 47, 59, 61, 67, 71, 79, 97, 103, 113, 127, 131, 191, 193, 199, 223, 227, 239, 241, 251, 257, 263, 271, 383, 449, 463, 479, 487, 499, 503, 509, 769, 911, 967, 991, 1009, 1019, 1021, 1031, 1039, 1087, 1151, 1279, 1543, 1567
Offset: 1
Examples
a(3)=5 is a term because it is the 3rd prime whose binary representation splits into no more than 3 runs: 5_10 = 101_2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Run-Length Encoding.
Programs
-
Maple
R:= 2,3: count:= 2: for d from 2 while count < 100 do for a from d-1 to 1 by -1 do for b from 0 to a-1 do p:= 2*(2^d - 2^a + 2^b)-1; if isprime(p) then R:= R,p; count:= count+1 fi od od; p:= 2^(d+1)-1; if isprime(p) then R:= R,p; count:= count+1 fi od: R; # Robert Israel, Oct 30 2024
-
Mathematica
Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] <= 3 &]
Comments